
-----------------------------------
FearSonic
Sat Apr 10, 2004 9:57 am

Creating Mario-Like Game, Need Help
-----------------------------------
I'm creating a Mario-like platformer game, and I'm having trouble having gravity implemented. I'm moving things around using Input.KeyDown, and using whatdotcolour for collision detection, since I don't know any other way. I just have a few questions:

1) How do I put gravity in, if my code is somewhat like this:
loop
    setscreen ("offscreenonly")
    Draw.FillBox (0, 0, maxx, maxy, 255)
    Draw.FillBox (400, 200, 500, 300, 0)
    Draw.FillOval (ballx, bally, 10, 10, 0)

    Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) then
        bally := bally + 1
    elsif chars (KEY_DOWN_ARROW) then
        bally := bally - 1
    elsif chars (KEY_LEFT_ARROW) then
        ballx := ballx - 1
    elsif chars (KEY_RIGHT_ARROW) then
        ballx := ballx + 1
    end if

    if bally + 10 >= maxy then
        bally := bally - 1
    elsif ballx + 10 >= maxx then
        ballx := ballx - 1
    elsif bally - 10 