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:
@@ -1,11 +1,27 @@
|
||||
from superturtle.animation import animate
|
||||
from turtle import forward, right
|
||||
from shapes import red_coin
|
||||
from turtle import *
|
||||
from shapes import *
|
||||
|
||||
def square(side_length):
|
||||
for side in range(4):
|
||||
forward(side_length)
|
||||
right(90)
|
||||
|
||||
for frame in animate(40, loop=True):
|
||||
size = frame.interpolate(50, 100, mirror=True)
|
||||
square(size)
|
||||
|
||||
for frame in animate(30):
|
||||
|
||||
penup()
|
||||
forward(100)
|
||||
pendown()
|
||||
black_tile(40)
|
||||
with frame.translate([-275, -150], [-225, -100]):
|
||||
|
||||
red_coin(20)
|
||||
goto(-175, -150)
|
||||
blue_coin(25)
|
||||
input()
|
||||
|
||||
|
||||
# for frame in animate(frames=30):
|
||||
# with frame.translate([0, 0], [100, 100]):
|
||||
# red_coin(25)
|
||||
|
||||
input()
|
||||
Reference in New Issue
Block a user