Username
Password
Are you new? Sign up now
I’ve forgotten
Home
:.
Downloads
:.
Articles
:.
Projects
:.
Reviews
:.
Forums
:.
Arcade
:.
Klikcast
:.
GOTW
The Daily Click
::.
Forums
::.
Klik Coding Help
::.
What is the best way to do a mouse controlled object on a grid?
Post Reply
Post Oekaki
Posted By
Message
Jon C-B
I create vaporware
Registered
23/04/2008
Points
237
14th August, 2011 at 20:28:50 -
I want the aimer for a game to be set to a 64 by 64 grid which i got working with the built in movement. but when the player moves out of the starting frame the object falls behind the position of the mouse. What is the best way to handle this?
n/a
UrbanMonk
BRING BACK MITCH
Registered
07/07/2008
Points
49667
14th August, 2011 at 21:46:36 -
Set X Position of Aimer to xmouse/64*64
Set Y Position of Aimer to ymouse/64*64
n/a
Jon C-B
I create vaporware
Registered
23/04/2008
Points
237
14th August, 2011 at 22:45:08 -
Thanks that works it is set to a 64 grid but its 32 pixels lower and to the right of the actual level frame for some reason
n/a
Chris Burrows
Registered
14/09/2002
Points
2396
15th August, 2011 at 00:23:36 -
Set X Position of Aimer to 32 + (xmouse/64*64)
Set Y Position of Aimer to 32 + (ymouse/64*64)
that should fix your problem
n/a
Jon C-B
I create vaporware
Registered
23/04/2008
Points
237
15th August, 2011 at 02:45:27 -
works great thanks!
n/a
Post Reply
1
All
Advertisement
Worth A Click