Summary of SpaceInvaders Video Game Using Mega32
This project replicates the classic Atari Space Invaders game on an MEGA32 microcontroller, focusing on minimizing TV flicker using hardware interrupts for sound and screen updates. The display is a 128x100 pixel screen with a 6x5 array of 10x8 pixel invaders. Due to processing limits, only 3 invaders are drawn per frame to avoid flicker, balancing game elements like player movement and bullet updates. The game includes basic features like scoring, player deaths, levels, and invader landings.
Parts used in the Atari Space Invaders MEGA32 Project:
- Atari Space Invaders game concept
- MEGA32 microcontroller
- Display screen capable of 128x100 pixel resolution
- Hardware interrupts for sound and TV display management
- Player input controls (implied)
Introduction
Our final project is the classic Atari version of spaceinvaders on the MEGA32. The story: A horde of space invaders are attempting to land on the planet’s surface. You play a heroic pixilated thing on the ground trying to stop them one bullet at a time. It wasn’t Half Life, but eh… it was the 80s.
The real challenge is implementing the game without television flicker or artifacts. With the MEGA32, we use “hardware interrupts” so that sound can easily be played without interfering with the TV paint interrupt. A simple points system and basic gaming mode functions- such as player “deaths”, invader landings, and subsequent levels- are of course supported.
High Level Design
General Considerations:
How big of a screen do we have to work with (in pixels)?
o We can easily generate a 128 by 100 pixel screen using the MEGA32
• Can we write all of the invaders to the screen in one frame cycle?
o No. It turned out that we needed 10 frames to write all 30 invaders to the screen. We write 3 invaders per frame, plus update bullets, player movements, and barrier changes. Attempting to write more than 3 invaders to the screen every frame (along with player logic etc…) leads to flicker.
• Resolution of one invader?
o We decided the classic Atari invader pixel dimensions were necessary for nostalgia purposes, so the dimensions of the invaders are 10 pixels by 8 pixels.
• Number of invaders per round?
o We decided that a 6 by 5 array of invaders was sufficient at this resolution
For more detail: SpaceInvaders Video Game