Commits

Brendan Howell committed 97ba3ee

cute animation example

Comments (0)

Files changed (1)

pycessing/data/examples/sinus-motion.cess

+import math
+
+wave = 0
+
+def setup():
+    pycessing.size(800, 600)
+    pycessing.framerate = 12
+
+def draw():
+    global wave
+    setBackground(127, 127, 127)
+    
+    for x in range(50, pycessing.getWidth(), 50):
+        for y in range(50, pycessing.getHeight(), 50):
+            dy = 10 * math.sin(wave + x)
+            dr = 255 * math.sin(wave + y + x)
+            setFillColor(dr, 127, 0)
+            circle(x, y + dy, 10)
+            
+    wave += 1