diff --git a/draft/index.html b/draft/index.html new file mode 100644 index 00000000..89656841 --- /dev/null +++ b/draft/index.html @@ -0,0 +1,1329 @@ + + + + + + + + + sketch_001 - pyp5js with Pyodide + + + + + + + + + + + + +

+ pyp5js running on top of pyodide +

+ + +
+
+ +
+
+
+             
+from pyp5js import *
+
+t = 0
+
+def setup():
+    createCanvas(600, 600)
+    stroke(250)
+    strokeWeight(3)
+    fill(40, 200, 40)
+
+
+def draw():
+    global t
+    background(10, 10)
+
+    xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True)
+    yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True)
+    for x in range(0, width, 30):
+        for y in range(0, height, 30):
+
+            angle = xAngle * (x / width) + yAngle * (y / height)
+
+            myX = x + 20 * cos(2 * PI * t + angle)
+            myY = y + 20 * sin(2 * TWO_PI * t + angle)
+
+            ellipse(myX, myY, 10)
+
+    t = t + 0.01
+
+    print(frameRate())
+              
+          
+
+
+ + + + + + +