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

Author
Message
badprogrammer
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location:
Posted: 10th Aug 2003 11:51 Edited at: 10th Aug 2003 15:17
I am trying to make a 1st person shooter. When you look down and continue looking down, however, you can rotate by 360 degrees. The same happens when you loo too far up. What can I do to solve this?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Aug 2003 15:20
you can trap the variable that controls it with some if statements

eg: if mx > 280 then mx = 280

this would stop it going past 280 on the mx variable.

Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 13th Aug 2003 16:26
You would also need to use another variable, due to the range being 360 degrees.

`Limit up movement at 70 deg
if mx > 70 and mx < 180 then mx = 70
`Limit down movement at 70 deg
if mx < 290 and mx > 180 then mx = 290

Brains are for idiots.

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM

Login to post a reply

Server time is: 2025-05-19 16:43:32
Your offset time is: 2025-05-19 16:43:32