Endgame: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page with "'''#endgame''' is a ZZT-OOP command that sets the player's health to 0, thus ending the game. '''#endgame''' can also be used to efficiently set the player's h...")
 
No edit summary
 
Line 9: Line 9:
</pre>
</pre>


If an <code>/idle</code> were inserted between the #endgame and the #give, then a game over would happen and then the player would be brought back to life with the game in the hyperspeed state.
If an <code>/idle</code> were inserted between the #endgame and the #give, then a game over would happen and then the player would be brought back to life with the game in the [[Tick#Game_speed|hyperspeed state]].


{{ZZT-OOP navbox}}
{{ZZT-OOP navbox}}

Latest revision as of 22:48, 27 December 2025

#endgame is a ZZT-OOP command that sets the player's health to 0, thus ending the game.

#endgame can also be used to efficiently set the player's health to an arbitrary value without causing a game over by using #give health on the same tick, as in this code example:

@HealthSetter
#endgame
#give health 100

If an /idle were inserted between the #endgame and the #give, then a game over would happen and then the player would be brought back to life with the game in the hyperspeed state.