generated from mwc/project_drawing
start to put the shapes together
something i figured out was that i need to save my progress more often. I get close to finishing the game but then i forget the changes i made and end up back at my last saved point. Im also going to try and build the whole code then simplify it, seems to be easier for me.
This commit is contained in:
22
shapes.py
22
shapes.py
@@ -13,13 +13,14 @@ def square(size):
|
||||
"Draws a square of side length `size`"
|
||||
for side in range(4):
|
||||
forward(size)
|
||||
left(90)
|
||||
right(90)
|
||||
|
||||
def black_tile(size):
|
||||
begin_fill()
|
||||
fillcolor('black')
|
||||
square(size)
|
||||
end_fill()
|
||||
input()
|
||||
|
||||
|
||||
def white_tile(size):
|
||||
@@ -40,4 +41,21 @@ def blue_coin(size):
|
||||
begin_fill()
|
||||
fillcolor('blue')
|
||||
circle(size)
|
||||
end_fill()
|
||||
end_fill()
|
||||
|
||||
|
||||
def black_row(size):
|
||||
repeat = [1, 2, 3, 4]
|
||||
for repeat in repeat:
|
||||
forward(size)
|
||||
right(90)
|
||||
sizes = [50,50,50,50]
|
||||
for size in sizes:
|
||||
begin_fill()
|
||||
fillcolor('black')
|
||||
black_row(size)
|
||||
end_fill()
|
||||
penup()
|
||||
forward(size * 2)
|
||||
pendown()
|
||||
input()
|
||||
|
||||
Reference in New Issue
Block a user