p5js Template
✓ Published0🌍 Public
UUtopiah
Last edited Apr 14, 2016
Created on Apr 14, 2016
This example shows a single red circle moving diagonally across a gray canvas, bouncing off the edges. Built with the p5.js library, the sketch uses the `setup()` and `draw()` functions to initialize a 886 by 348 pixel canvas and animate the circle’s position. The `ellipse()` API draws the shape, while global variables track its x and y coordinates and speed; reversing the speed when the circle hits the canvas boundaries creates the bouncing effect. No external data is used.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/Utopiah/'>Utopiah</a>'s block: <a href='http://bl.ocks.org/Utopiah/42fa9fbd2e1dfa2874a087fdc105337b'>P5JS with color testing</a>