class Paddle extends GameObject {
// …
onCollide() {
ball.playWobble();
ball.vel.x = -5 * (this.pos.x - ball.pos.x);
}
}Randomizing gameplay / notebook
Randomizing gameplay
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.