XMLGameEngine

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

View the Project on GitHub beefviper/XMLGameEngine

41. Asteroids

Status: built (games/asteroids.xml, tests/test_asteroids.cpp); new verbs and tags: <heading>, <drag>, <hidden>, <turn>, <thrust>, <release>; <fire> now takes a group and follows the heading; <inc>/<dec> take an amount

Why this game

Asteroids (Atari, 1979) needs what Lunar Lander (34) left out: a ship that turns and is pushed along the way it faces, shots that leave its nose, a ship that coasts and slowly loses speed, a screen with no edges, and rocks that break into smaller rocks. Pixel collisions and <wrap /> already existed; everything else about facing and breaking is new.

The game as described

An 800 by 600 window. The ship is a triangle of four lines. Left and right turn it, up thrusts along the way it faces, space fires. Four big rocks drift in; a shot breaks a big rock into two medium ones, a medium into two small ones, a small one into nothing. A big rock is worth 2, a medium one 5 and a small one 10, each one <inc variable="ship.score">N</inc>. Three ships; a rock touching the ship costs one and the ship starts again in the middle. All rocks gone is a win.

What it tests

Decisions

Options considered

Approximations

The ship comes back at the middle straight away, with no wait for a safe spot. A pool member has the same velocity every time it is released. One wave only, no flying saucer, no sound. Headings are rounded to a whole degree.