Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

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


Sign up now

Problems with movement in 2d

4: Adsense

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.


  • You cannot reply to this topic
2 replies to this topic

#1 mrman131   Members   

122
Like
Likes
Like

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;

#2 wardekar   Members   

122
Like
Likes
Like

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


#3 Zenroth   Members   

127
Like
Likes
Like

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.