A p5-like canvas library for quick web graphics and games. Simple API, no framework—just include the script and define setup() and draw().
Include popps.js before your script. Your script defines setup() and draw().
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://js.cadenpopps.com/popps.js"></script>
<script src="your_script.js"></script>
</head>
Important: popps.js runs draw() at a fixed 60 fps by default. This keeps game physics and frame-based logic consistent across different displays (60Hz, 120Hz, 144Hz). Without throttling, higher-refresh monitors would run games 2x or more too fast.
setup() or later.function setup() {
createCanvas(400, 400);
loop(); // or loop(30) for 30 fps
}
function draw() {
background(0);
if (frameCount % 60 == 0) { /* every second at 60fps */ }
}
initPoppsJS() runs.preload() and setup(), preload runs first; when assets are ready, setup runs.setup() runs immediately.loop() in setup (or when ready). draw() is then called ~60 times per second.parentId is given, use that element; otherwise append to body. Returns the 2D context.createCanvas(800, 600); createCanvas(400, 400, "gameContainer");
fill(255) gray, fill(255,0,0) red, fill(255,0,0,0.5) half-transparent.