
-----------------------------------
lufthansa747
Tue Dec 01, 2009 8:51 pm

Ball bouncing around the screen
-----------------------------------
Here is my program that makes a ball bounce around

View.Set ("graphics:max;max,offscreenonly,nobuttonbar")
var x : int := maxx div 2
var y : int := maxy div 2
var radius : int := 20
var xint, yint : int := 5
var upState, sideState : int := -1
Draw.FillBox (0, 0, maxx, maxy, black)
Draw.FillOval (x, y, radius, radius, white)
loop
    if x - xint = maxx and sideState = 1 then % check right wall
        sideState := -1
    end if
    if y + yint >= maxy and upState = 1 then %check top wall
        upState := -1
    end if
    if y - yint 