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.

Dark GDK / Having Trouble with Rotating Sprites?

Author
Message
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 7th Aug 2013 18:38 Edited at: 9th Aug 2013 00:22
Hi! When I press Left or Right, my sprite can't rotate continually, It only rotates to the specified angle. Can you help me?
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 7th Aug 2013 20:48
Hi davidbillmanoy, Can you post your code, it will help me help you.
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 7th Aug 2013 22:35
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 7th Aug 2013 22:35 Edited at: 9th Aug 2013 00:21
Unfortunatley this forum is strict at posting for new members so sorry about the bump of the messages.
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 7th Aug 2013 22:37
Here you go.

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Aug 2013 19:39
What is "the specified angle"?
Your code looks like it should work, although rotating it 5 degrees 60 times per second is probably a bit fast.
If you're holding both the left and right arrow keys down the angle adjustments would cancel each other out, but apart from that I can't see why that shouldn't work.


"Why do programmers get Halloween and Christmas mixed up?"
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 9th Aug 2013 00:26
The specified angle is 0 to 359. It stops at the specific angle. I forgot to use:
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 9th Aug 2013 20:55
I think it wraps internally, but try ensuring that your angle stays in the [0..360] range. dbWrapValue(in_angle) will do this for you. Like it's name suggests an angle of 362 would wrap around to 2°, and -12° <=>348°.


"Why do programmers get Halloween and Christmas mixed up?"
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 10th Aug 2013 01:25
I don't mean the wrap I mean int angle.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 10th Aug 2013 21:02
If you didn't declare the variable your code wouldn't compile.
I'm starting to loose track of what the issue is here, or did you resolve it?


"Why do programmers get Halloween and Christmas mixed up?"
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 14th Aug 2013 19:47
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 21st Aug 2013 16:25
Nevermind Im good.
davidbillmanoy
11
Years of Service
User Offline
Joined: 7th Aug 2013
Location:
Posted: 30th Aug 2013 02:14
Timmy Top Hat can you help me?

Login to post a reply

Server time is: 2024-11-18 21:52:36
Your offset time is: 2024-11-18 21:52:36