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.

DarkBASIC Discussion / Please help with my rotations

Author
Message
Vusay
21
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Ozzfest (Yeah right)
Posted: 22nd May 2004 23:50
I want to get my object (object 6) to, when you press up, start rotating forward towards the ground. However, I need it to start rotating slowly and speed up. Any help will be greatly appreciated. Thanx.

he who runs away, lives to fight another day
GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 23rd May 2004 05:47 Edited at: 23rd May 2004 05:47
Try something like...

If Upkey()=1 Then TSpeed#=TSpeed#+0.01 Else TSpeed#=TSpeed#/1.03
Pitch Object Down 6,TSpeed#

Well... I hope that helps...

He who smites and runs away, lives to smite another day... (unless the person he is trying to smite avoids being smited and is faster than than him, then the person who was trying to do the smiteing becomes smitten)...

Previously known as "Game_Creator".
The question is, why am I talking to myself? ...... And more importantly, why am I waiting for a reply?
sarin
21
Years of Service
User Offline
Joined: 20th Mar 2004
Location: nowhere
Posted: 23rd May 2004 06:12
use something that would check the object rotation. Use the command object angle x(1) to check the angle. Your thing should look almost like this:

rx#=object angle x(1)
If rx#<5 then pitch object down 1,1
if rx#<10 and rx#>5 then pitch object down 1,2
if rx#<15 and rx#>10 then pitch object down 1,3

etc...etc...
this should work

Sarin
Vusay
21
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Ozzfest (Yeah right)
Posted: 23rd May 2004 12:08 Edited at: 23rd May 2004 12:09
Thanks Gamekit and Sarin. Both of you helped a lot. Game kit, your code worked great and Sarin, I've found another use for Sarins' so thanks.

Gamekit - Is there a way I can get my object to rotate back to zero gradually as well. That way, when you release the joystick/upkey the object will rotate back to 0 degrees.

he who runs away, lives to fight another day

Login to post a reply

Server time is: 2025-05-24 02:51:20
Your offset time is: 2025-05-24 02:51:20