-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathcherry031
More file actions
28 lines (23 loc) · 967 Bytes
/
cherry031
File metadata and controls
28 lines (23 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import IPython
from anime2021.anime import AShape, AStudio, ACanvas, test_shape, ARectangle, APolygon, RollingPolygon
import math
class GuruGuruwashingmachine(AShape):
def __init__(self, width=100,height=150, N=None, cx= None, cy=None, color=None):
studio = AStudio()
AShape.__init__(self,width,height,cx,cy)
self.shape = ARectangle(width,height,cx=105,cy=155,color='lightgray')
self.shape1 = APolygon(width,N=1000,cx=190,cy=20,color='white')
self.shape2 = RollingPolygon(width, N=10,cx=105,cy=205,color='skyblue')
for i in range(100):
studio.render()
def render(self,canvas,tick):
self.shape.cx = self.cx
self.shape.cy = self.cy
self.shape1.cx = self.cx
self.shape1.cy = self.cy
self.shape2.cx = self.cx
self.shape2.cy = self.cy
self.shape.render(canvas,tick)
self.shape1.render(canvas,tick)
self.shape2.render(canvas,tick)
IPython.display.Image(test_shape(GuruGuruwashingmachine()))