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 Professional Discussion / Dark Basic Pro Newb (sorry :-))

Author
Message
zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 25th Feb 2011 22:05
Hey all

Please go easy on me, I understand the very basics of action-script and I'm now trying my hand at Dark Basic Pro for some 3D action!
I have a question though and if possible a great explanation to go with it.
I have got my camera (0) to move around a 3d space using this code

but what I really need is a bit of code that makes the camera move forward when I press 'space bar' and the faster I press space bar the faster the camera (0) moves forward.

Thanks in advance

www.bensimms.co.uk
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 25th Feb 2011 23:19
check out using (inc)
renny

Life is not fair, so deal with it.
http://www.gusroundtable.com/
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 26th Feb 2011 01:48
Don't worry, everyone started out as a noob at one point.

This is pseudo-code as the computer I'm posting from does not have DBpro installed, but here's a simple example of how you would use the inc and dec commands to increase and decrease the value of a variable by a value, based on the amount of time between key presses.



Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Feb 2011 11:38
There is a command that simply moves the camera forward, add in a speed that is controlled with the spacebar, and your set. You will have to keep a record of the space key for 2 cycles, so the player has to release it before pressing again.



Health, Ammo, and bacon and eggs!
zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 26th Feb 2011 11:40
Guys, you are legends! I've just seen the responses thank you for your time. I'm now going to have a proper read of the advice and give it a whirl! Thanks again

www.bensimms.co.uk
Travis Gatlin
17
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 27th Feb 2011 02:45
Quote: "Guys, you are legends"

No

YOUR the legend! LOL

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Feb 2011 13:35
Lol!

We like helping folk out, offers a nice little distraction from our own projects .

Health, Ammo, and bacon and eggs!
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 27th Feb 2011 15:18
yes that is true

Life is not fair, so deal with it.
http://www.gusroundtable.com/

Login to post a reply

Server time is: 2026-07-16 18:25:00
Your offset time is: 2026-07-16 18:25:00