Graphics 800,600,0,-1 Cls DrawRect 0,0,50,10 Flip Tank:TImage = CreateImage(50,10,1) GrabImage(Tank,0,0) MidHandleImage Tank Global TX#,TY# Global PX,PY Global SpeedX# Global SpeedY# Global TSpeed# = 1.5 TX = 200 Ty = 200 While Not KeyHit(Key_Escape) Cls PX = MouseX() PY = MouseY() Local angle:Int = ATan2(TY-PY,TX-PX) SpeedX = Cos(angle)*TSpeed SpeedY = Sin(Angle)*-TSpeed TX:-SpeedX TY:+SpeedY SetRotation Angle DrawImage Tank,Tx,Ty SetRotation 0 Flip Wend
I hope this will help you.