1
Ask a Question / Re: Make actor follow user selected path...
« on: March 01, 2012, 05:37:13 pm »
Ok, I am officially confused.
On the floor tile actors I have a behaviour which switches the animation between selected and not selected when clicked/touched by the user. Also, if the player collides with it, the animation switches to fade animation and it is now selectable again.
Next I added a game attribute boolean called 'selected'. This states in the tile behaviour that when the animation for self is 'selected' the boolean 'selected' is also true and when the current animation or the tile is 'unselected' the 'selected' boolean is false.
Now I am trying to create a behaviour for the player that states when x of selected tile is greater than x of player it moves right. However, how do I declare the 'x' value of selected since it is only a boolean and an animation? Does this mean I will need to change it so that when the user clicks a tile it changes to a new 'selected' actor rather than an anim, so will therefore have an 'x' value?
This seems like a bad idea as increasing the actors will only make the game heavier, unless I include some kind of kill action.
I am sure I am probably looking at this the wrong way.
Thanks in advance.
Superfried
On the floor tile actors I have a behaviour which switches the animation between selected and not selected when clicked/touched by the user. Also, if the player collides with it, the animation switches to fade animation and it is now selectable again.
Next I added a game attribute boolean called 'selected'. This states in the tile behaviour that when the animation for self is 'selected' the boolean 'selected' is also true and when the current animation or the tile is 'unselected' the 'selected' boolean is false.
Now I am trying to create a behaviour for the player that states when x of selected tile is greater than x of player it moves right. However, how do I declare the 'x' value of selected since it is only a boolean and an animation? Does this mean I will need to change it so that when the user clicks a tile it changes to a new 'selected' actor rather than an anim, so will therefore have an 'x' value?
This seems like a bad idea as increasing the actors will only make the game heavier, unless I include some kind of kill action.
I am sure I am probably looking at this the wrong way.
Thanks in advance.
Superfried