That's a pretty good list of things that need doing. However, it requires a little bit of thought to properly break it down into classes. Let's assume for now, you intend to make a reasonable first step: a demo which spawns a stream of lemmings which then wander about one screen of sculpted terrain. Like the original, assume everything is done at the pixel level.
Intro screen
Level cards
Victory/failure cards
These are among the last things you'll be doing. Don't worry about these.
Level initialisation
Let's say your prototype takes a single level name as an argument.
When your program first runs, it constructs a GameState object called gs.
It then calls the gs.LoadLevel("name") method. This method should do something like the following:
- Try to load the level data from disk and parse it into a Level data structure
- Check which GraphicsSet the Level uses, and try to load the GraphicsSet pieces into video memory
- Create one large graphics buffer of the whole level and paint it with GraphicsSet pieces according to the Level terrain placement info.
- Create some sort of clever hashing mechanism for collisions based on the Level info (e.g. terrain, exits, water, traps)
After that, you can call a method such as gs.Step() (update the lemming positions) followed by gs.Paint() (write changes to the screen). This, of course, has to be repeated for every single frame.
Level completion
This happens when you run out of lemmings and you're no longer inserting new ones. At this point, your game loop should stop.
Lemming state
You have a Lemming object for each lemming, stored in the GameState object. Each Lemming will be of a certain state (walker, faller, builder) and will have a different per-frame movement behaviour based on that state.
Pick a skill
That's just input control. Worry about that later.
Assign a skill (if possible)
This is just changing the state of the chosen Lemming object and deducting one from the appropriate skill counter.
Skill implementation
This is done in your Lemming object as something which gets checked each frame. I think I figured out bits of the movement by cranking DOSBox down to 10 cycles and watching the freeze-frame edition of Lemmings. All you need to know for walking is:
- Collisions are measured at one pixel directly underneath the feet.
- If the ground ahead is between a -2 to +2 difference in height (making sure to check in the order 1,2,0,-1,-2), advance the lemming onto that bit of ground.
- Technically a lemming can jump up to 5 pixels in height, however you need to set an intermediate state called a bounder which advances up 2 pixels/frame so it doesn't look weird.
- Anything higher than 5, turn him around. Anything lower than -2, set him as a faller (which drop at a constant rate of 3 pixels/frame).
How Lemmings can affect terrain
How Lemmings can be affected by objects
Terrain collision
I can't really give advice about the best way to do collision detection, as the way I did it was pretty piss-poor (make a whole seperate RGBA copy of the level, with each of the 32 bits in each pixel representing terrain, steel, trap hotspots etc.).
Counters for skills, time remaining
Array for Lemmings
You keep the counters as variables in your GameState object. Same with your Lemmings, in an array or similar large data structure.
Lemming animation
Depends on the presentation backend you intend on using, but you'd want to load it in a globally-accessible cache much like your GraphicsSet. It's probably better for video memory to store animation in long strips, where each frame can be blitted from by using an offset and a common frame width. Lemmings is quite nice in the respect that each animation corresponds with a specific state.
What kills a Lemming, why
See collision detection. The lemming death animation is stored in the trap itself, so all you need is to make the lemming disappear and activate the trap.
Windows frontend
Mac OS X frontend
Again, these last guys depend on the language and presentation backend you intend on using. You mentioned C#; while I think it's easily the best thing Microsoft has ever made (the second, of course, being
SkiFree. No,
Chip's Challenge was phoned in from Epyx and doesn't count), using the provided graphics bindings (DirectX, XNA and friends) will kick you in the nuts if your plans are multiplatform.
SDL.net might be worth a look, as that can (hopefully) run on Windows .NET and OSX/Linux Mono.