Controlling Multiple Actors!

VeggieBurgrVeggieBurgr Member Posts: 2
edited November -1 in Working with GS (Mac)
Hello, I'm new to this so please bear with me :)

I have 64 separate actors in the scene. I've set up rules and attributes so that when one actor is touched, it activates (changes image). When touched again, the actor is deactivated (reverts to original image).

The problem is that I want to only allow for ONE activation/deactivation at a time. Currently, the player can activate as many actors as they please, and then deactivate however many they choose. I want the player to deactivate the actor, before it can activate a new actor.

Thanks in advance! :)

Comments

  • BreckenBrecken Member Posts: 143
    Have a self attribute in each actor called dected. boolean attribute.

    When touch is pressed change attribute self.dected to true

    So in the move or accelerate or whatever you have. Say that self.detect needs to be true for the actor to move.

    hope this helps =)

    PL
  • old_kipperold_kipper Member Posts: 1,420
    If you want only one actor to active at one time you will have to have a game or scene boolean attribute that flags when an actor is active and disables other actors from being chosen. In the touch rules that select/deselect a particular actor add a condition that the game.actorselected is false and then change the attribute to true. When it is deselected make it false.

    hope that helps

    kipper
  • VeggieBurgrVeggieBurgr Member Posts: 2
    @old_kipper and @PLStudio, thanks for your response.

    I took your advice and created a game attribute to serve as a flag. When one actor is activated I set the game attribute to false. There is a rule that says actors can only be activated when the game attribute is true. When a activated actor becomes deactivated, the game attribute changes to false. However, I still have the problem that the other actors are still active, despite the game attribute.

    I've linked screen shots to help in this matter. FYI, there are other attributes here that allow for the actor to change image to depict activation vs. deactivation - this can be disregarded.

    Thank you for your time and help!

    1) https://skitch.com/anishunleashed/f4e5e/cube-crusher-grid-prototype

    2) https://skitch.com/anishunleashed/f4eha/cube-crusher-grid-prototype

    3) https://skitch.com/anishunleashed/f4eh9/cube-crusher-grid-prototype
  • old_kipperold_kipper Member Posts: 1,420
    The self attribute isn't necessary as you can do the check with the state of the self image or alpha if they change when 'active'. If you are having problems with things switching in and out off the one touch, then look at the 'toggle button' demo available within the new project window of the editor. You shouldn't need a timer.

    kipper
Sign In or Register to comment.