Physics Tutorial Needed

BlitzMax Forums/BlitzMax Beginners Area/Physics Tutorial Needed

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Wave's tutorials are always excellent.
In case it helps in the meantime...
' I have problems on my laptop with drawoval and DX drivers.
SetGraphicsDriver GLMax2DDriver()
Graphics 640,480,0
' gravity = gravity, yvel= Ball's speed in y direction, ypos = balls y pos, yground 
Global gravity:Float=0.5, yvel:Float=-10.0,ypos:Float=400.0, yground:Int=400
While Not KeyHit(key_escape)
   Cls
' draw the ground
   DrawLine 0,yground,600,yground
' output yvel so we can see it changing
   DrawText "yvel : " + yvel,0,0
   If yvel < 0 DrawText "Moving up",0,10
   If yvel > 0 DrawText "Moving down",0,10
'draw the 'ball' in current ypos
   DrawOval 200,ypos,20,20
' This will either reduce or increase y velocity depending on direction.
   yvel=yvel+gravity
' change ypos by the speed
   ypos=ypos+yvel
' if ypos hits the ground
   If ypos >= yground 
' reset it's position to the gound
       ypos=yground
' reverse the direction of yvel
       yvel=-10
' Comment the previous line and uncomment the next line to have the ball come to rest.
'      yvel = -yvel
  EndIf
' get rid of unwanted memory
   FlushMem
   Flip
Wend