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 / I need some help/information about MouseMoveX/Y

Author
Message
Trev
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Canada, Ontario
Posted: 5th Dec 2004 01:55
I'm working on a SOS game that uses a grid and you place either n S or an O Inside of a sqaure of your grid by moving the mouse thieir n clicking...is what i want it to do but I'm having a problem with the mousemovex/y cammand heres the code

what I tryed to do is when the mouse moves 20 pixels right/left it increases a counter putting the letter perfectly inside the gird sqaure. But the mousemove command updates to quikly and this makes it so letters appear everywhere with little controll to the player.. so if you know of something i'm doing wrong or a better way of doing this plz post.

Trevor Somerville
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Dec 2004 03:15
Are you sure it wouldn't be easier to just use mousex() and mousey() values? I think the value of mousemovex() is determined by the mouse's speed, rather than its position.


Trev
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Canada, Ontario
Posted: 5th Dec 2004 03:28
o if its judge by speed then thats probly y its not working lol i thought it calculated the distance when the player starts moving the mouse n when they stop moving the mouse

Trevor Somerville
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 5th Dec 2004 15:26 Edited at: 5th Dec 2004 15:36
mousemovex() and mousemovey() is determined by how far the mouse has moved since the command was last called. So if you call it every loop and you never move 20 units in one loop it will never work as they are set to 0 when called. Save them to variables and inc them each loop.



Or something similar.

[edit] This is an example. Though using mouse position commands might be easier.



Login to post a reply

Server time is: 2024-11-13 18:56:39
Your offset time is: 2024-11-13 18:56:39