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 movement x and y only

Author
Message
Tucker
14
Years of Service
User Offline
Joined: 20th Jun 2010
Location: Earth Prime
Posted: 7th Oct 2010 06:15
Hey,
I have a camera attached to an object, but my controls need to be controlled by the mouse, only x and y needed, as its going to be a dodging game. Code is below, what is the most efficient and easiest way to go about using the mouse for this movement?
I can only get the mouse to control the camera, but would like the camera fixed in one direction, and change it to the mouse controlling the object.



Bow Chika Bow Wow
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 7th Oct 2010 16:27
This code moves and rotates the camera dynamically. Press the LMB to move forward and the RMB to move backward. It moves the cube/camera whichever way you are facing. If you want to adapt it to only move on the x and z axis, it could be easily modified.



I'm not really a programmer.....I only play one on TGC.
Tucker
14
Years of Service
User Offline
Joined: 20th Jun 2010
Location: Earth Prime
Posted: 10th Oct 2010 06:58
Ok, I sorted it out, what is the best way to add gravity? its going to be a boulder dodging game, but the player going forwards instead of boulders coming down on the player? So what direction and how would I put gravity into that?




Bow Chika Bow Wow

Login to post a reply

Server time is: 2024-11-23 07:26:48
Your offset time is: 2024-11-23 07:26:48