Here is a very simple one...
Rem Project: Bouncing Balls
Rem Created: 20/02/2003 12:45:46
`create some variables..
BallX = 320
BallY = 240
BallSize = 20
SpeedX = 2
SpeedY = -3
Border = 25
`initialize the program
SYNC ON
HIDE MOUSE
`set the color
color = RGB(0,200,255)
INK color, 0
`start main loop
DO
`clear screen
CLS
`draw the border
LINE 0,0,639,0
LINE 639,0,639,479
LINE 639,479,0,479
LINE 0,479,0,0
`move the ball
BallX = BallX + SpeedX
BallY = BallY + SpeedY
`check conditions for BallX
IF BallX > 640 - Border
BallX = 640 - Border
SpeedX = SpeedX * -1
ELSE
IF BallX < Border
BallX = Border
SpeedX = SpeedX * -1
ENDIF
ENDIF
`check conditions for BallY
IF BallY > 480 - Border
BallY = 480 - Border
SpeedY = SpeedY * -1
ELSE
IF BallY < Border
BallY = Border
SpeedY = SpeedY * -1
ENDIF
ENDIF
`draw the ball
CIRCLE BallX, BallY, BallSize
`redraw the screen
SYNC
IF SPACEKEY() = 1 THEN EXIT
LOOP
Have fun!!
It's never as easy as it looks!