"flashing before next spawn, yet invulnerable" attribute. (somewhat finished)
Homebrew_Kid
Member Posts: 21
When the main actor is destroyed, I would like to spawn the main actor again but only after the player has chosen where to spawn the main actor. This will be accomplished after 3 seconds. I will edit more as I go along but I'd love to get some insight while I try to code this.
I have a "dropzone" actor as the precursor to the newly spawned main actor, allowing the player to have some time to decide where to spawn the actor. This thinking comes from the classic "flashing before next spawn, yet invulnerable" attribute.
My original thinking:
- Damage taken from enemy will Change Attribute game.Health to game.Health-1 (down from 1).
- When game.Health is <= 0, set game.Player Alive boolean to false.
- When game.Health is <= 0, spawn the precursor actor.
- (In progress: Change Attribute game.Health to game.Health+1)
- Destroy main actor.
- The precursor actor will spawn the new main actor after 3.0 seconds.
- The precursor actor will be destroyed after 3.0001 seconds.
- Repeat
Current progress:
Edit: Finished
- Main actor is set in stage.
- Main actor is destroyed.
- Spawn precursor actor.
- Unable to move precursor actor.
- Spawn Main actor 3 seconds later.
- Precursor actor is not dead.
I have defined a boolean to recognize whether the player is alive or dead. This is is a rule under the main actor.
Comments
I realized I need to add the game.Health to game.Health+1, as the player dies instantly from game.Health=0.
Trying to add new rules for game.Player Alive true or false.
Anyways, I finished what I started so hopefully I could be of help to anyone trying to do the same. Spawn actor underneath is as follows. The living or not living boolean was not needed. Feel free to use it.
Flashing of the player sprite comes from very early platform games which were released on extremely low-powered systems (such as NES or Atari 2600). Therefore the only visual effect available was to flash the sprite character on and off. Modern systems could do much more, such as surrounding the sprite with a flashing gold halo but, strangely, games usually stick to the same old visuals (which can result in the player unable to see their character).