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.

2D All the way! / rotate sprite

Author
Message
Fa1con
16
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 28th Oct 2007 00:09
hi i was just wondering i can make my sprite rotate when i press a key but how do i make him keep rotating if i hold down my key?

heres my code:


thanks in advance,
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 28th Oct 2007 01:31 Edited at: 28th Oct 2007 01:45

(10's a bit much though, methinks)

Or, to go one better:

(Don't just jump forth with this code without looking up keystate)

Or alternatively:

(storing the angle in a# and updating at the end, your lines are shorter and easier)

And not forgetting:

(b# sorts out how far in which direction)

EBA; UI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
Fa1con
16
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 28th Oct 2007 05:52
That was exactly what i wanted. thank you so much

Login to post a reply

Server time is: 2024-05-18 11:20:05
Your offset time is: 2024-05-18 11:20:05