GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 Posts: 9,913Member

    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 Posts: 11Member, PRO

    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 Posts: 11Member, PRO

    nope i cant make it work there is something missing

  • arbetnuhijiarbetnuhiji Posts: 11Member, PRO

    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 Posts: 9,913Member
    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 Posts: 11Member, PRO

    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.