Question: Activate actors on click?

MaartenWinkels

  • Posts: 34
Hello everybody,

I am working on a new project since a long time. It is team focused so you have 4 characters.
When you press on 1 character you can select another one, they will have special abilities in order to solve several puzzles.
My question is, how am I able to activate Player1 when also Player2 is in the game. So in that position you have 2 actors and I only want that you can move 1 of them, for example Player1 so Player2 will stand still on his current position.
I would like to hear from you guys!

-Maarten

mdotedot

  • Posts: 1654
Hello Maarten,

What I do for my game is to set an attribute to a value and check for that value in a move-behavior. 
Instead of an attribute you could use the actor->Properties Set and Get attribute blocks, but it helps to have a behavior that you can attach to all your actors that have this type of logic.

Hope it helps.

Best regards from
M.E.

PS. Je naam doet nederlands aan dus ik ga er even van uit dat je dat ook bent. Welkom hier en succes met je spel!
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

MaartenWinkels

  • Posts: 34
Hello Maarten,

What I do for my game is to set an attribute to a value and check for that value in a move-behavior. 
Instead of an attribute you could use the actor->Properties Set and Get attribute blocks, but it helps to have a behavior that you can attach to all your actors that have this type of logic.

Hope it helps.

Best regards from
M.E.

PS. Je naam doet nederlands aan dus ik ga er even van uit dat je dat ook bent. Welkom hier en succes met je spel!

Thanks for your quick answer.
I will try it out and will tell you if it works fine.

-Maarten

Offtopic: Ik ben inderdaad een Nederland, bedankt!