-
Click Movement
Ok first I would like to say thins is my first post.
This maybe a question that is way beyond me right now, but here we go.
Can you have your player move with a mouse click or such, like a RTS game? Is it easy to do?
Any help would be great, i have searched the forums and can't seem to find what i'm looking for but I may have over looked it.
Thank
Jgooler
-
Re: Click Movement
You only need one event:
User clicks- Set X position of player to XMouse, Set Y position of player to YMouse.
-
Re: Click Movement
Thanks.
I got that but I was looking for a point and click then the player would walk that direction. The way above makes you jump.
(maybe i'm doing something wrong)
Jgooler
-
Re: Click Movement
You could have an invisible active object and when the mouse is clicked, set it's position to the x and y coordinates of the mouse:
*Left Mouse Clicked
= Set X position of Invisible object to XMouse
= Set Y position of invisible object to YMouse
Then have your player objects movement as Bouncing Ball and have a condition for it:
*Always
= Direction - Look in the Direction of - then in the Dialog box click relative to button, select the invisible object, then set the x and y boxes to 0
Instead of the Always condition, you could use Player Active is overlapping Invisible Active, and add a movement stop action as this would stop it juddering about when they meet, but you'd also need a start action for when they aren't overlapping
There are more ways to do it but that's probably one of the easiest
-
Re: Click Movement
I'll give that a try thanks.
Jgooler
-
Re: Click Movement
Also, you could use the move by bezier object using linear movement. It does this quite well (plus it's really easy).
-
Re: Click Movement
if you are wanting an RTS movement I suggest you look at the advanced pathfinding object. It allows path movement which is perfect for most RTS games. Same as you see in classic games sucha C&C and AOE etc