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.

Newcomers DBPro Corner / mouse control

Author
Message
hpfan273
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 20th Jan 2007 04:33
ok... this may sound stupid... but does any body know a code that will control an FPS with your mouse... like... if u move ur mouse to the left... you look left... and the same for right, up, and down... how???

THANKS FOR STOPING AT A RED LIGHT... AND LETTING ME CRASH INTO YOU AT 80 MILES AN HOUR!!!
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 20th Jan 2007 06:05 Edited at: 21st Jan 2007 07:11
Try to figure it out with this. Hit the F1 key in the Dark Basic Pro Editor to see the slightly useful help.

Use these commands to create the loop:
do
loop

These move the camera:
move camera
rotate camera
position camera

These get user input:
upkey()
downkey()
leftkey()
rightkey()
keystate(ascii value) (this is in case you don't want to use the arrowkeys as what move the camera)
mousemovex()
mousemovey()

Edit: Or you could use Gil's code. It's more confusing than just rotating and moving the camera, but it's probably slightly faster.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 20th Jan 2007 06:43
because I find it a bit confusing myself, I'll give you the code I use:

Make sure you define "spd#" .

Pirates of Port Royale
Live the life of a pirate.

Login to post a reply

Server time is: 2024-09-25 15:20:34
Your offset time is: 2024-09-25 15:20:34