Deleting actor

arantesarantes Member Posts: 5
edited November -1 in Working with GS (Mac)
Hi all,

I have made an game where an certain actor get spawned when you press the 'start' button. I have also made an 'restart' actor and I want this on to destroy the just apawned actor when this actor get pressed.

I especially choose for this way because I don't want the whole scene or game to be reset.

Now I would like to know if it's possible to destroy an certain (spawned) actor when you pressed another (restart) actor.

I have tried some ways with the game attributes and played around with true and false states but he only checks this attributes when the scene or game is started? Not when you're allready in the scene, or is there a way to 'recheck' these game-attributes?

Thank you in advance,

Arantes

plus: it has to be possible te get this actor again on the stage when the user presses 'start' again.

Comments

  • ChaserChaser Member Posts: 1,453
    Use a 3rd actor as the spawner
    So touch start it sets a global game attribute to 1 or something in the third invisible actor when that global attribute is 1 spawn actor 2
    When actor 2 is pressed destroy and set global attribute to 2

    Edit
    You can have it spawn at position x and y for the start
  • arantesarantes Member Posts: 5
    Thanks for your post! I have it almost working.

    Now I have an problem. Because when I delete the spawned actor it can't be spawned again later when pressing the start button? Is there another way instead of deleting it completely?
  • ChaserChaser Member Posts: 1,453
    You could always set it's Alpha to 0 and have it interpolate to a position just off screen. Then when you press start again have it change alpha to 1 and interpolate it to a certain position on screen
  • arantesarantes Member Posts: 5
    Thank you, that works fine :)!
Sign In or Register to comment.