actor moving on grid

inflameinflame Member Posts: 11
edited February 2012 in Working with GS (Mac)
Can u help me on this. I have several actors on board. They must move with mouse button in x and y direction. Not in angular.
Also for example when actor 1 is next to actor 2 it must stop.

I tried several methods and used every template i found on web and useless.
This is template i'm using now
http://gshelper.com/?p=330

It's a grid moving but with keyboard. I tried replacing keyboard moving with mouse (touch is pressed) and failed.
Also tried adding another actor to grid and nothing.

Is there any way to use this template but with mouse moving actor?
Can someone please help me on this.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2012
    You could use a directional pad, but you'd have to pass the position of the actor to game attributes and back since the rules in that template use self.position.X and Y.

    The only other way I can see to do it is to keep track of the distance (magnitude) from the mouse click to the actor to decide if the player should move in a specific direction. It's not hard to do, but it is quite time consuming to code.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • GLGAMESGLGAMES SingaporeMember Posts: 988
    your actor moves one grid every press or is it continuous in that direction?
    you could probably set up 4 directional tap or click zones on the scene so that when mouse click within the specific zone then move in that direction.
  • NY415NY415 Member Posts: 25
    edited February 2014
    ,
Sign In or Register to comment.