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
1 reply to this topic

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

Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

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.



PARTNERS