/// bouncing ball w/in box void setup() float ballX=250, ballY=250; float ballDX=3, ballDY=2; void setup(){ size(500,500); reset(); } void reset() { } void draw() { //// Next frame. //// scene(); action(); } void scene() { background(0); table(); } void table() { rectMode(CORNERS); rect (25,25,475,475); fill(225,10,200); stroke(255); strokeWeight(5); } void action() { ball(); collisions(); } void ball() { // move & draw ballX += ballDX; ballY += ballDY; ellipseMode(CENTER); ellipse (ballX,ballY,10,10); } void collisions() { //// Check crashing //++++++++++++ }