Enemy movement updates enemy positions during the game loop according to stored movement rules. A simple version moves meteors downward from random positions near the top of the screen until they reach the planet’s surface. section 8.3
A basic movement routine follows this process:
- Loop through the enemy slots and skip entries whose active-data flag is clear. section 8.3
Extending movement for richer enemies
Store each enemy’s horizontal change, vertical change, size, sprite count, and score value in enemy data. Apply DX to X and DY to Y, remove enemies that reach the ground, check collisions with the player and the player’s bullet, update lives or score, and advance through the enemy records. section 12.4 section 12.0
