Should switch to SDL 2.0

Current SDL development is largely with the 2.0 version. There is much legacy code for 1.2 but there is a fairly clear migration document. The lisp-builder-sdl API does not clearly match SDL 1.2 documentation, there are a number game related simlification which can be gleaned from the examples, but you can’t start with the SDL 1.2 documenation. Learning more about SDL 1.2 is a waste of time.

the-invaders code base

Working code with cell animations

The code for the-invaders works. The sprite graphics are useable. The game was clearly modeled after tweekable system with a lot of global varables. The cell animation for the ship, enemy and mothership has a unified sprite sheet model but the animation rotation is different more each element. The enemy ship animation is complex as is the motion control.

Graphic objects are structs

The graphic objects are series of structs all with x and y slots. There is a list of all active graphic object by type Each time step check a series of motions and positions are updated. User events and by random chance created new objects. Collision events are detected and object are removed. Exploded objects are removed based on a countdown.

CLOS graphic object could make motion and collision detection centralized

Graphic objects could be placed in CLOS classification system. This has the benifit of simplication of (mothership-x *mothership*) into (x *mothership*). Collsion detection is done in three or four places. Collsion boundary are hard coded in collision detection code. Enemy-shot against the player ship. Player-shots against the enemy elements. Player-shots against the mothership.

Countdown infrastructure could simpify explosion graphics

The explosion graphics could be auto removed based on a countdown timer.

Boundary detection could simplify code.

Several playfield bounds type issues for the shots, enemy players and mothership are spread at various places in the code.

Motion control could be centralized

It may be possible to abstract motion controllers for the shots, enemy, mothership and player ship. There are the following types of motion control, keyboard conrol (for the player ship), fixed velocity (shots, mothership, explosions), complex zig-zag (enemy ships).

Bugs and Error

There are several errors related to the positioning of player-ship explosions.