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 / Rolling an object

Author
Message
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 27th Feb 2011 06:58 Edited at: 27th Feb 2011 08:01
Hi, I am trying to make a flying game in which the player races around a track I have made. At the moment I have the plane moving around, albeit in a pretty bad way but what I would like to ask is about the dbRollObjectLeft/Right.

At the moment I am rolling it right 30 when the left key is pressed. All it does it is continually do a 360 roll. How would I make it so that when it reaches the right amount of roll I wish to achieve it stops rolling anymore?

This is the code I tried and I assume I have set the variables at the top wrong and resetting it's position but I just can't think of how to do it.....


Think of my game as being like Wipeout (if you have played it). That's the kind of movement, roll, turning I'd like to try and get close to.

Thanks
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 27th Feb 2011 12:48
the update function is called once a loop, normally, the game is at 60fps, which means the update function is called 60 times every second, in each call you roll 30 degrees, so you are rolling 30*60 degrees per second, that's why it looks like 360degree rotation

Login to post a reply

Server time is: 2024-11-19 12:24:55
Your offset time is: 2024-11-19 12:24:55