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 / Messed up Mouse control

Author
Message
Duncanla
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 25th Jan 2003 22:37
I have a mouse control so that i can look up and down and to the sides and I use the keypad to strife and go forwards and backwards. The mouse control code is very simple but it seems very choppy. Can anyone tell me why? i have the code snippet below, i also have some code in the program to make sure that it can't go off the matrix or run into walls but that shouldn't effect this because it doesn't move anywhere, just looks around. I also have code that makes sure the camera can't flip upside down so it can only rotate 180 degrees on the x axis but i don't see how this could make it choppy.

cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)

Rem Make sure camera can't flip upside down
if cAX# 180 then cAX#=270
if cAX# > 90 and cAX#
Duncanla
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 25th Jan 2003 22:41
wow, that was supposed to do a code snippet thing, my bad, i'll try again.



Epidemicz
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 26th Jan 2003 00:38
Try this out, might be what you are looking for.



I am the very disease you pretend to be.
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 26th Jan 2003 01:43
if you want to limite the rotation of the camera :



I'm following John, but I'm not john.
Lol, it is funnier in french
Duncanla
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 27th Jan 2003 03:41
Thanks, it works a lot better now. i think i just needed to ajust some of the numbers that i had. the only problem with it now is that pauses for like half a second when you change directions. ie. you're turning left and then go to turn right it stalls for just the slights moment but it's enough to notice but if there isn't anything to do then i won't be that bad. Any ideas?

Epidemicz
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 27th Jan 2003 04:12
What do you have the smoothing set to?

I suggest 1.6.

I am the very disease you pretend to be.
Archangel
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 27th Jan 2003 14:17
what aobut the
mouseclick(1) thing for firing?

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Jan 2003 17:10
Don't use inkey for moving around as this causes pauses when you change from one key to another (bloody annoying).

Use the other methods of input control, like keystate for example

I love it when a plan comes together
Duncanla
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 22:58
I have the smoothing set to 1.6 and i use the downkey(), upkey(), etc. for movement It's just when i change directions with the mouse it pauses for a little bit

Login to post a reply

Server time is: 2024-11-23 23:03:09
Your offset time is: 2024-11-23 23:03:09