moving an actor on the screen with mouse position
rjacomen
Member, PRO Posts: 19
I need to be able to move an actor through a maze with just mouse position. Wherever I move the mouse the actor moves. I assume it would be when mouse is inside the actor, but how can I get it to move everywhere I move the mouse? The user of the game will not be able to click mouse buttons or keyboard due to a disability, but can move the mouse using a track ball.
Comments
constrain x position to mouse x position
constrain y position to mouse y position
you can put these in a rule and say. if touch is pressed or if mouse position is inside
do constrain x position to mouse x position
constrain y position to mouse y position
now when you press on the actor and move the mouse somewhere else the actor will follow.
I think this is what you want, good luck!
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
if touch is inside do:
constrain x position to mouse x position
constrain y position to mouse y position
when you release the touch the actor wont follow your mouse, and when you touch the actor again he will follow you
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page