Im not sure how to make make gravity in 3D but in 2D I do it this way.
Graphics 800,600,8,2
SetBuffer BackBuffer()
Global person = LoadImage("person.bmp")
Global ground = LoadImage("ground.bmp")
Global onland = True
Global x = 0
Global y = 100
While Not KeyHit(1)
If onland = True
If KeyDown(200)
y = y - 10
onland = False
EndIf
EndIf
If KeyDown(205) Then x = x + 3
If KeyDown(203) Then x = x - 3
If onland = False Then y = y + 2
DrawImage person,x,y
DrawImage ground,0,100
If ImagesCollide (ground,0,100,0,person,x,y,0)
onland = True
EndIf
Delay 100
Cls
Flip
Wend
|