- #1
Canning
- 7
- 0
I am writing a 2d computer game and need some help.
I have a spaceship that is moving(or stationary) and I want to move it to a destination coordinate.
Here are the main variables:
I have a spaceship that is moving(or stationary) and I want to move it to a destination coordinate.
Here are the main variables:
Code:
Const PI = 3.14159 'Mmmm.. Pi
Const ACCEL = 0.1 'Rate of increase of speed
Const ROTATION_RATE = 15 'Rotation speed
Const SHIP_RADIUS = 10 'Distance from center of triangle to any vertex
Const MS_DELAY = 25 'Milliseconds per frame (25 = 40 frames per second)
Dim msngFacing As Single 'Angle the ship is facing (ok, ok, it's a triangle, not a ship! Shut it!)
Dim msngHeading As Single 'Current direction in which ship is moving
Dim msngSpeed As Single 'Current speed with which ship is moving
Dim msngX As Single 'Current X coordinate of ship within form
Dim msngY As Single 'Current Y coordinate of ship within form