Physics How To

Blitz3D Forums/Blitz3D Userlibs/Physics How To

Graphics 512,512,0,2
SetBuffer BackBuffer()

xp#=100
yp#=100
xg#=0
yg#=0


While Not KeyHit(1)

   mx=MouseX()
   my=MouseY()

   ;Richtungsvektor an Geschwindigkeit anlegen
   xg=xg+(mx-xp)/100.0
   yg=yg+(my-yp)/100.0

   ;Ein einfacher Luftwiederstandersatz
   xg=xg*.98
   yg=yg*.98

   ;Geschwindigkeit an Position anwenden
   xp=xp+xg
   yp=yp+yg

   Color 255,0,0:Line mx,my,xp,yp
   Color 255,255,0:Oval xp-4,yp-4,9,9,1
   Color 255,255,255:Rect mx-4,my-4,9,9,0

   Flip
   Cls
Wend
End


Just a beginning ;)