Counter: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page with "A counter is a numeric value that can be manipulated in ZZT-OOP using the #give and #take commands. ZZT provides six counters: * '''health''' - the player's health, * '''ammo''' - the number of ammunition held by the player, * '''gems''' - the number of gems held by the player, * '''torches''' - the number of torches held by the player, * '''score''' - the player's total score, * '''time''' - the ''elapsed''...")
 
No edit summary
Line 11: Line 11:


Other than '''time''', which is specific to the current board and reset on every entry, each counter's value is persistent throughout the entire [[world]].
Other than '''time''', which is specific to the current board and reset on every entry, each counter's value is persistent throughout the entire [[world]].
== Bugs/Quirks ==
TODO: Document the consequences of the counter being a signed 16-bit value?


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

Revision as of 13:02, 24 December 2025

A counter is a numeric value that can be manipulated in ZZT-OOP using the #give and #take commands.

ZZT provides six counters:

  • health - the player's health,
  • ammo - the number of ammunition held by the player,
  • gems - the number of gems held by the player,
  • torches - the number of torches held by the player,
  • score - the player's total score,
  • time - the elapsed time on the board, if the board has a time limit. Not used if the board does not have a time limit.

Other than time, which is specific to the current board and reset on every entry, each counter's value is persistent throughout the entire world.

Bugs/Quirks

TODO: Document the consequences of the counter being a signed 16-bit value?