Skip to main content
100%

p5js Template

✓ Published0🌍 Public
YYannael
Last edited Apr 14, 2016
Created on Apr 14, 2016

A p5.js template demonstrates a simple bouncing ball animation within a canvas. The sketch initializes a circle at a random position and moves it with constant horizontal and vertical speeds, reversing direction when it hits the canvas edges. The code uses p5.js functions `createCanvas`, `background`, `stroke`, `ellipse`, and the global `width` and `height` variables. It draws a red, unfilled circle with a stroke weight of four on a gray background, updating its coordinates each frame in the `draw` loop.

AI-generated description

Built 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>

forked from <a href='http://bl.ocks.org/Utopiah/'>Utopiah</a>'s block: <a href='http://bl.ocks.org/Utopiah/54f92111e29a3c79f9572ae028ce30fd'>P5JS with color testing</a>

Similar vizzes