Hello, world!

Zheyu Liu
Data Mining the City
2 min readSep 9, 2018

Welcome to Zheyu(Joree)’s world!

You can see three houses, one park, and a road. It’s pretty simple but organized. The blue circle moving along the road represents me in a sports car.

The following is my original sketch.

def setup():
#this is your canvas size
size(500,300)
background(201,215,78)
global road_width,house_height,house_width,shadow_width
road_width = 30
house_height = 40
house_width = house_height + 10
shadow_width = house_height - 20
def draw():
#this is the main road
noStroke()
fill(142,142,142)
rect(320,0,road_width,road_width)
rect(320,0+road_width,road_width,road_width)
rect(320,0+2*road_width,road_width,road_width)
arc(320-road_width,0+3*road_width, road_width*4, road_width*4,0, HALF_PI)
fill(201,215,78)
arc(320-road_width,0+3*road_width, road_width*2, road_width*2,0, HALF_PI)
fill(142,142,142)
rect(320-2*road_width,0+4*road_width,road_width,road_width)
rect(320-3*road_width,0+4*road_width,road_width,road_width)
rect(320-4*road_width,0+4*road_width,road_width,road_width)
arc(320-4*road_width,0+6*road_width, road_width*4, road_width*4,PI,PI+HALF_PI)
fill(201,215,78)
arc(320-4*road_width,0+6*road_width, road_width*2, road_width*2,PI, PI+HALF_PI)
fill(142,142,142)
rect(320-6*road_width,0+6*road_width,road_width,road_width)
rect(320-6*road_width,0+7*road_width,road_width,road_width)
rect(320-6*road_width,0+8*road_width,road_width,road_width)
rect(320-6*road_width,0+9*road_width,road_width,road_width)

#This is the houses
fill(220,195,16)
rect(50,50,house_width+10,house_height)
fill(187,151,29)
rect(40,50,shadow_width,house_height)
fill(86,49,28)
rect(40,50+house_height,2*house_width-30,5)
fill(220,195,16)
triangle(40+shadow_width+house_width/2,30,40+shadow_width,50,40+shadow_width+house_width,50)
fill(198,201,290)
quad(40+shadow_width, 30, 40+shadow_width+house_width/2, 30, 40+shadow_width,50, 40, 50)

fill(220,195,16)
rect(120,50,house_width+10,house_height)
fill(187,151,29)
rect(110,50,shadow_width,house_height)
fill(86,49,28)
rect(110,50+house_height,2*house_width-30,5)
fill(220,195,16)
triangle(110+shadow_width+house_width/2,30,110+shadow_width,50,110+shadow_width+house_width,50)
fill(198,201,290)
quad(110+shadow_width, 30, 110+shadow_width+house_width/2, 30, 110+shadow_width,50, 110, 50)

fill(220,195,16)
rect(200,50,house_width+10,house_height)
fill(187,151,29)
rect(190,50,shadow_width,house_height)
fill(86,49,28)
rect(190,50+house_height,2*house_width-30,5)
fill(220,195,16)
triangle(190+shadow_width+house_width/2,30,190+shadow_width,50,190+shadow_width+house_width,50)
fill(198,201,290)
quad(190+shadow_width, 30, 190+shadow_width+house_width/2, 30, 190+shadow_width,50, 190, 50)

#This is a park
fill(150,215,211)
ellipse(360, 180, 100, 55)
fill(147,173,14)
triangle(380,210,410,150,440,210)
fill(131,143,0)
triangle(380,210,410,150,390,210)
fill(142,154,4)
ellipse(395,132,30,30)
fill(60,59,39)
triangle(390,160,395,132,400,160)
fill(142,154,4)
ellipse(387,128,30,30)
fill(60,59,39)
triangle(382,154,387,128,392,154)

fill(255,138,34)
rect(240, 220, 150, 50, 7)
f = createFont("Arial", 124, True)
textFont(f,24)
fill(0)
text("Hello World",255,255)

#This is the moving ball
fill(128,173,178)
ellipse(mouseX, mouseY, 15, 15)

--

--