Jump to content

  • Log In with Google      Sign In   
  • Create Account


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.

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

#1 mrman131   Members   -  Reputation: 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;

Sponsor:

#2 wardekar   Members   -  Reputation: 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   -  Reputation: 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.



PARTNERS