View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Problems with movement in 2d

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1mrman131  Members

Posted 03 August 2001 - 03:41 PM

Using what I could gather from the articles at this site, I assembled the following code. Unfortuanately, it yield erratic results and the object does not move as I want it to (not even in the right direction). procedure TCar.move(); begin X := X + int(speed * cos(angle)); Y := Y - int(speed * sin(angle)); end;

### #2wardekar  Members

Posted 03 August 2001 - 03:51 PM

Keep in mind you have to have the angle where straight right is 0 and increases counter-clockwise from there. Also you have to use Radians as the angle, Radians=Degrees*pi/180. Hope that helps.

~WarDekar

### #3Zenroth  Members

Posted 03 August 2001 - 03:52 PM

I think your problem may be is that cos/sin except radians not degree''s. I could be wrong though.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.