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 / What's wrong with my camera? is going in the opposite direction . .

Author
Message
Programador hispano
17
Years of Service
User Offline
Joined: 11th Jul 2006
Location: Dallas, TX
Posted: 1st Oct 2009 10:59
I am trying to control the camera with the mouse, when I push forward and backwards on the mouse the camera goes up and down like I want it to go, but when I push the mouse to the left the camera goes to the right and when I push the mouse to the right the camera goes to the left, How do I switch them?



...........(o o)........
--oooO--(_)--Oooo---
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Oct 2009 12:21
I see a few problems in your code. The first one is the if statement, because it will always be false, no matter how you rotate your camera. Your camera angle can not be smaller than 90, and at the same time be larger than 270.

So naturally, the only code being executed is the code between the else and endif.

So, delete everything except for that, so you have the following code:



Changing polarity on the y axis is easy, you just change the -mousemovex() to a +mousemovex()



Now to make sure the camera doesn't go over 90 and 270, add this at the end:



So the full code will look like this:



Enjoy!

TheComet


Make the paths of your enemies easier with WaypointPro!

Login to post a reply

Server time is: 2024-05-01 21:17:11
Your offset time is: 2024-05-01 21:17:11