XMLGameEngine

An engine for describing games built around Xerces, exprtk, and SFML.

View the Project on GitHub beefviper/XMLGameEngine

26. Scrolling and screen regions

Status: idea; nothing built (all built games fit one screen)

The gap

The language describes non-scrolling games. Scrolling games need a camera, a world larger than the window, and often a fixed area (a status bar) next to the moving one. 13 asks whether scrolling belongs to the camera, the world, or is a verb; this note collects the alternatives.

Alternatives for where scrolling lives

Regions also give parallax cheaply (each band its own rate) and let a HUD live outside the world without special cases.

Camera behaviors worth naming

Coordinates

Expressions such as window width and center already position things per window size (07). With a camera the author needs both world and screen coordinates of an object; the current dotted references could grow a world/screen qualifier.

Level data

A larger world needs a way to place many objects: a map. Options discussed for authoring:

Early exchanges about this also asked whether maps have several layers or one, and how a step onto a certain tile triggers an event; suggested element names for a tile map were hitbox, map and tile. A tile that fires a rule on entry is a natural trigger form next to object collisions (14).

The earlier VGDL work uses a text level map with a legend; the same idea in XML is a legend element plus rows. Which of these reads best in XML is undecided.

Pacing and routes

Level layout is part of design too. One discussion argued that speed-based games feel unbalanced when the fast stretches keep being interrupted by hazards, and suggested a structure in which a fast segment branches into different slower, more deliberate sections. The point for the language: routes and branches are a level-data feature (named exits leading to different regions), not a verb.

Sources