Movements

I have a problem i want to have 2+ players on scene lets say 2 and i want when i select one player movements righ,left,up,down to appear and when ill move lets say left or right i want only the player that is selected to move on that direction is that possible to do because i cant figure it out.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Sure. Make a game level attribute integer attribute "player" set it to 1 as a default. Wrap the move rules for each actor in a rule inside them.

    Actor 1.

    Add a rule

    When touch is pressed

    Change attribute game.player to 1

    Rule

    When game.player = 1

    Your move rules for actor 1 inside this rule

    Actor 2

    Add rule

    When touch is pressed

    Change attribute game.player to 2

    Rule

    When game.player = 2

    Your move rules for actor 2

  • arbetnuhijiarbetnuhiji Member, PRO Posts: 11

    it seem logical i did it but there is a problem when i touch the player imeddiately starts to move in a direction without waiting for the right buton to be pressed but this i s a good start i will try to figure it out.thank you.

  • arbetnuhijiarbetnuhiji Member, PRO Posts: 11

    nope i cant make it work there is something missing

  • arbetnuhijiarbetnuhiji Member, PRO Posts: 11

    ok i managed to make the first player when i touch him he moves fine but when i touch the second player it doesnt move at all because the first player stays selected all i need is when i select the second player the first player to be deselected

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited November 2015

    The code above works. If you did it like I showed when you touch the second actor it will cut out the other actor. Post a sceenshot of your rules.

  • arbetnuhijiarbetnuhiji Member, PRO Posts: 11

    Yes i did it it is working perfectly now i have another problem i opened a thread for that but thank you very much you was very helpful

Sign In or Register to comment.