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 / Mousesteering

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 16th Aug 2004 04:19 Edited at: 16th Aug 2004 04:20
How do I get to steer an object with a mouse?
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 16th Aug 2004 05:58
Here's first person mouselook.





do

x=mousemovex(): y=mousemovey()

xangle#=camera angle x()
yangle#=camera angle y()

yangle#=wrapvalue(yangle#+x)
xangle#=wrapvalue(xangle#+y)

rotate camera xangle#,yangle#,0

if upkey() then move camera 10
if downkey() then move camera 10

sync

loop

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 16th Aug 2004 06:19 Edited at: 9th Sep 2004 00:15
Would that steer an object ? I will try it out but I need it to steer an object and that is a control for a camera
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 16th Aug 2004 06:48
It's not exactly hard to convert that to an object!

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 16th Aug 2004 06:50
Yes I did it but I am getting wierd things happening


What am I doing wrong now?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 16th Aug 2004 06:52
Er - what exactly is happening?

That code wasn't meant to run straight away, it was to be slotted in somewhere in your main loop

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 19th Aug 2004 08:08 Edited at: 9th Sep 2004 00:15
I see well David don't worry I got it sovled for me so ihe problem is solved

Login to post a reply

Server time is: 2025-05-25 08:28:51
Your offset time is: 2025-05-25 08:28:51