respawn actor
Dooki
Member Posts: 247
how do i respawn an actor after it dies? Someone else asked something similar but reset scene. I don't want this. Thanks!
Comments
- actor has three lives in game.
- I have it set up that when he collides with enemy he gets destroyed.
- I want him to respawn/reset to try again.
- Oh, I just realized that once all three lives are done then what? I need to reset the scene ("Try again") after all the lives are up. I think I remember seeing this on the forum. Gotta search for this one!
- I have a game.lives attribute set up for three lives.
- I have a controller that when game.lives=0..........change scene (Currently to a nav page that has "try again" and "main menu." I know that I could also perhaps spawn a "try again" button/actor.
- OK, so I don't know how to set up how to respawn an actor once it gets destroyed and you have two more lives left. FYI, my actor starts out in a specific location and is free moving. So, he could get killed across the screen but I need him to respawn back in the original location.
Hopefully this will give you some more ideas. Sorry I couldn't give a real solution....
Rule: When collide with with tag Bullets"
-Timer= 1sec
--Spawn image (actor getting shot)
--Play sound (impact sound)
--Destroy
--Change attribute: game.gamelives To: game.gamelives-1
-Timer= 2sec
--Spawn actor ( I've been playing the X,Y settings to get the actor to spawn in the original location.)
Thoughts? Thanks!
Here is what I have for the controller:
Rule
Attribute: game.playerlive=0
-Spawn actor
---------------
I created the attribute "playerlive" =1, and I added into my main actor's collision rule that when he gets hit (destroyed) it changes the attribute of playerlive to "0." Then with the controller in play the main actor is respawned. Hope someone out there can help??!