
-----------------------------------
Zacebdal
Sun Oct 22, 2006 7:03 pm

Gravity Redone
-----------------------------------
This is yet another attempt at a gravity program..again, any suggestions or comments are more than welcome and very much appreciated. Thanks.  var x, check, y, spd : int
var key : array char of boolean
setscreen ("graphics,offscreenonly")
x := 10
y := 50
procedure draw
    drawoval (x, y, 10, 10, black)
    drawline (x, y - 10, x, y - 30, black)
    drawline (x, y - 30, x - 10, y - 40, black)
    drawline (x, y - 30, x + 10, y - 40, black)
    drawline (x - 10, y - 20, x + 10, y - 20, black)
    drawline (1, 10, maxx, 10, black)
end draw
draw
check := 0
spd := 0
loop
    View.Update
    Input.KeyDown (key)
    if check = 0 then
        if key ('w') then
            spd := 32
            check := 0
        end if
    end if
    if key ('d') then
        x := x + 5
    elsif key ('a') then
        x := x - 5
    end if
    if y >= 51 then
        check := 1
    elsif y = 50 then
        check := 0
    end if
    if spd > 0 then
        spd := spd div 2
    elsif spd < 0 then
        spd := spd * 2
    end if
    if spd = 1 then
        spd := -1
    end if
    y := y + spd
    if y 