Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
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
1 reply to this topic

#1 mrman131   Members   

122
Like
Likes
Like

Posted 03 August 2001 - 03:48 PM

I am having problems with the movement code in 2d enviorment. I have read the stuff on the site, and implemented what they say, but it doesn''t seem to work. When I try to move, it gives erratic results. Any help would be apprieciated. procedure TCar.move(); begin X := X + int(speed * cos(angle)); Y := Y - int(speed * sin(angle)); end;

#2 Anonymous Poster_Anonymous Poster_*   Guests   

Likes

Posted 03 August 2001 - 04:12 PM


Is your variable ''angle'' in radians or degrees? If it is in degrees (which I assume it is) you''ll need to do something like this:



X := X + int(speed * cos(2*3.141593*angle/360));
Y := Y - int(speed * sin(2*3.141593*angle/360));







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.