XMLGameEngine is a VGDL (video game description language) and an engine for running games completely contained within an XML file.
Status: Built. A Value variant and anchors are ideas. Reference: the game file.
+ - * /, brackets, names, numbers; load/calc) or one value tag: <formula> (arithmetic) or <random>. A value holds text or a tag, not both.<random> is drawn at load and again whenever its object comes back into play (a reset, <reveal>, <release>, <fire>; Game::drawStartAgain), so every Pong serve is new. A random size with a random sign is <sign> of a random.<pick> from a list, an integer <random>, a <count> of a class.<inc> amount was fixed at load, so a fish could not add its own worth.<set> and <spawn>, is kept raw (CmdLive) and made again by makeCommand each time it runs, so no verb needs to know. Rejected: each verb evaluating its own fields (every verb twice), every command live (wasted work on every bounce).x, y, velocity.x, heading, altitude, light, blink, and touch.* in a rule) are bound into the arithmetic before a value is worked out. Only a command’s value may read them; anywhere else would read 0, so the load stops.self. is written out to the object’s own name before evaluation (nameSelf).window.*, every owner.variable), then evaluate, so score1 can read paddle1.score written later. Globals go in written order.ball.radius is a symbol with a dot in it. Owned objects are named by path, so a reference splits at its last dot. layOutScenes writes every name out in full first, inside out (scenes).<variable>s are named constants. Changing state lives on objects (paddle1.score); a game-wide changing variable was never needed.<number> is one owner.variable redraws when it changes.| Option | Verdict |
|---|---|
| Polling | Chosen: simple, fits a declarative file |
| Listeners | Cleanup and wiring do not look declarative |
| Copying the value | Goes stale |
| Raw pointers | Dangle when storage moves |
Value variant (int, float, bool, string); references as {handle, variable} resolved after the first pass.name.width and .height in positions. A text’s position is unknown until the window measures it, then worked out again whenever a size it names changes.width shadows its size (the variable wins, keeping old games working).window.width.center - name.width / 2 was written 330 times in 23 games, because positions name an object’s top-left corner.anchor="center" on a position (an attribute: it picks a point); one setting in <window>; a game-wide default a position can change. It must stay an element or attribute, never parsed from a string.name and an optional class, borrowed from HTML id and class: one thing, or every thing of a kind. One condition on class="paddle" covers both paddles.