Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Routing one sprite towards another position

Author
Message
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 27th Jul 2007 06:13
Hello, this is the code that will rotate sprite (spr) towards a location (Xdest# and Ydest#) when executed once every move. However the target angle calculation seems to be inaccurate so when the target angle is reached by the sprite the sprites angle will flicker slightly which is not very nice, or smooth to look at. Speed# is defined prior to this segment of code as 4

This is the current code



Any ideas chief?

Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 27th Jul 2007 17:36 Edited at: 27th Jul 2007 17:37
Because you inc it when it equals 180 and dec it back.

"Oh hey, nice website Jimmy, it's really nice and fancy." -- That C++ Nerd
Visit. Website. NOW!
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 27th Jul 2007 17:38
That would be true, except the angle is not 180 degrees when the flickering happens. It happens at any angle.

Login to post a reply

Server time is: 2024-11-25 13:38:27
Your offset time is: 2024-11-25 13:38:27