generated from mwc/project_drawing
made the blue piece move
I was struggling to figure out how to put the animation code into my code. i had to change up the code for my piece so they were made separate and then move them. it was hard to figure out have to calculate which way the piece would go but i got one to move
This commit is contained in:
53
shapes.py
53
shapes.py
@@ -30,3 +30,56 @@ def black_tile(size):
|
||||
right(90)
|
||||
|
||||
|
||||
def black_row(times):
|
||||
sizes = [50,50,50,50]
|
||||
for size in sizes:
|
||||
begin_fill()
|
||||
fillcolor('black')
|
||||
black_tile(size)
|
||||
end_fill()
|
||||
penup()
|
||||
forward(size * 2)
|
||||
pendown()
|
||||
|
||||
def game(times):
|
||||
penup()
|
||||
goto(-300, 200)
|
||||
pendown()
|
||||
board(400)
|
||||
|
||||
"first row"
|
||||
black_row(1)
|
||||
flyto(-300, 150)
|
||||
forward(50)
|
||||
|
||||
"second row - white tile first"
|
||||
black_row(1)
|
||||
flyto(-300, 100)
|
||||
|
||||
"third row - black tile first"
|
||||
black_row(1)
|
||||
flyto(-300, 50)
|
||||
forward(50)
|
||||
|
||||
"fourth row - white tile first"
|
||||
black_row(1)
|
||||
flyto(-300, 0)
|
||||
|
||||
"five row - black tile first"
|
||||
black_row(1)
|
||||
flyto(-300, -50)
|
||||
forward(50)
|
||||
|
||||
"six row - white tile first"
|
||||
black_row(1)
|
||||
flyto(-300, -100)
|
||||
|
||||
"seven row - black tile first"
|
||||
black_row(1)
|
||||
flyto(-300, -150)
|
||||
forward(50)
|
||||
|
||||
"eight row - white tile first"
|
||||
sizes = [50,50,50,50]
|
||||
black_row(1)
|
||||
flyto(-300, -200)
|
||||
|
||||
Reference in New Issue
Block a user