Animated random boxes in p5.js & python

Just converted a p5js sketch I had called “Bouncing Colorful Balls” to PyScript:
https://PyScript.com/@gotoloop/bouncing-colorful-balls

The original p5*js sketch had 2 versions:

  1. Global Mode
  2. Instance Mode

And I made 2 versions for PyScript:

  1. Imports the original “ball.mjs” as a JS module.
  2. Imports its own converted “ball.py” Python module.

Besides those HTML files, “index.html” shows all 4 of them.

While “all.html” shows 4 p5*js sketches, 2 global & 2 instance mode versions.

Those 4 sketches teach many techniques on how to write/convert p5*js sketches to PyScript syntax.

1 Like