Robot: Difference between revisions

From MZXWiki
Jump to navigation Jump to search
m (Reverted edits by Sharpnova (Talk); changed back to last version by Wervyn)
 
(Rewrite Robot article.)
Line 1: Line 1:
'''Robots''' are the main power behind any [[MegaZeux|MZX]] games that are more than rudimentary, and are analogous to Objects in [[ZZT]].  Their use provides a unique approach to game programming by naturally encouraging game designers to divide their program code into discrete, self-contained parts which effectively run as separate threads.  Robots are often used to represent objects and actors within the game, to govern effects and changes to the game world, and to implement [[Engine|engines]]. Robot code is written in Megazeux's own programming language, [[Robotic]], and its uses can be surprisingly versatile given the kludgy nature of the language itself.
[[Robot|Robots]] are [[built-ins]] which are capable of executing [[Robotic]] scripts. They are the most powerful type of built-in, and the main power behind all but the simplest [[MegaZeux]] games.


[[Category:MegaZeux]]
Robots are often used to represent objects and actors within the game, to govern effects and changes to the game world, and to implement [[Engine|engines]].
{{stub}}
 
==Behavior==
Robots execute a number of [[commands]] in their Robotic script every cycle determined by the current value of the [[COMMANDS]] counter. When a command halts the program—either temporarily through a [[cycle|cycle-ending]] command such as [[WAIT]], or indefinitely through [[END]]—or when the commands limit is reached, the Robot automatically yields execution to the next object on the board. This makes Robots analogous to [https://en.wikipedia.org/wiki/Coroutine cooperative coroutines] in other programming languages.
 
==ZZT connection==
Robots are analogous to Objects in [[ZZT]].
 
[[Category:MegaZeux]] [[Category:MegaZeux built-in objects]]

Revision as of 01:00, 29 May 2025

Robots are built-ins which are capable of executing Robotic scripts. They are the most powerful type of built-in, and the main power behind all but the simplest MegaZeux games.

Robots are often used to represent objects and actors within the game, to govern effects and changes to the game world, and to implement engines.

Behavior

Robots execute a number of commands in their Robotic script every cycle determined by the current value of the COMMANDS counter. When a command halts the program—either temporarily through a cycle-ending command such as WAIT, or indefinitely through END—or when the commands limit is reached, the Robot automatically yields execution to the next object on the board. This makes Robots analogous to cooperative coroutines in other programming languages.

ZZT connection

Robots are analogous to Objects in ZZT.