Sunshine Community

zx2263
Data Mining the City
2 min readSep 19, 2018

Hand sketch:

Explanation of community:

1 Area 1 is a group of residential building where people live in and each house easily access to beach area

2 Area 2 is comprised by eight small park that include pool, fountain (number 3) and bench(number4).

3 Number 5 is a community center that has gym and different activity room for resident. Also here is the largest entrance to beach so when pressed mouse here will show a picture of beach.

Code:

def setup():
size(900,1000)
background(255,255,224)

global roadwidth, squareSize, centerSize, SsquareSize, img
roadwidth = 40
squareSize = 100
centerSize = 200
insideCircle = 20
SsquareSize = 40

# make a new instance of a PImage by loading an image file
# decalring a variable of type PImage
img = loadImage("sunshine.jpg")

def draw():
#grid
x = 60
y = 40
i = (1,3,5,7,9)

for column in xrange(0,4):
for row in xrange(0,4):
fill(255,165,0)
rect(x + column * (squareSize + roadwidth), y + row * (squareSize + roadwidth),
squareSize, squareSize)

for column in xrange (4,5):
for row in xrange (0,4):
fill(0,128,0)
rect(x+column * (squareSize + roadwidth),
y + row * (squareSize + roadwidth),
centerSize, squareSize)

for column in xrange (0,4):
for row in xrange (4,5):
fill(0,128,0)
rect(x+column * (squareSize + roadwidth),
y + row * (squareSize + roadwidth),
squareSize, centerSize)

for column in xrange (4,5):
for row in xrange (4,5):
fill(255,165,0)
rect(x+column * (squareSize + roadwidth),
y + row * (squareSize + roadwidth),
centerSize, centerSize)
if mousePressed:
image(img, x+column * (squareSize + roadwidth),
y + row * (squareSize + roadwidth),
centerSize, centerSize)

#inside nest
x=60 + column * (squareSize + roadwidth)
y=40

for column in xrange (0,4):
for row in xrange (0,4):
if row == 1:
fill(0,191,255)
else:
fill(139,69,19)
rect(x + 20 + column * 40,
y + row * (squareSize + roadwidth) + 30,
SsquareSize, SsquareSize)
x=60
y=40 + row * (squareSize + roadwidth)

for column in xrange (0,4):
for row in xrange (4,8):
if column == 1:
fill(0,191,255)
else:
fill(139,69,19)
rect(x + column * (squareSize + roadwidth) + 30,
y + row * 40,
SsquareSize, SsquareSize)

--

--