Purpose: To build a complex game in Mode 4 to further your understanding of: double buffering, palettes in Mode 4, text, DMA, and images in Mode 4.
Instructions:
For this homework, you will create a complex game in Mode 4. The complexity expectation is the same as the last homework assignment, but this time, images are required. You may NOT extend a game you already made for a previous assignment; you MUST create something new. Outside of helper files (myLib.c, myLib.h, font.c, font.h, etc.), you also may not extend a previous lab to fit the requirements of this homework.
You are free to choose one of the examples we provide, but you are also free to create your own original game (if you choose this option, please speak with a TA first so that we can ensure it is on the expected difficulty level).
Requirements:
Your game must have the following:
- At least one struct
- At least one array
- Pooling
- Meaningful text
- It needs to be relevant to the game
- Non-static text
- This means the text changes while you are looking at it (erased then redrawn)
E.g. score that visibly updates during the game
- A state machine with the following states: Start, Pause, Game, Win/lose
- You can have a Win state, a Lose state, or both
- DMA used correctly for fillScreen4(), drawRect4(), drawImage4(), and drawFullscreenImage4()
- At least one non-fullscreen image
- At least one fullscreen image
- At least five moving objects
- At least three buttons used for input
- Collision that matters (i.e. something must happen whenever two different objects hit each other)
- Atxt file
- An instruction manual (of sorts) that tells a player how to play your game Only a minimal amount of flicker
Your code must have the following:
- Be entirely written in Mode 4
- Having the Mode 3 functions alongside the others in myLib.c is fine, as long as you never call them.
- Multiple .c files (more than just main.c and myLib.c)
- At least two .h files
- Good organization (see tips below)
- Meaningful comments
Examples of games at the complexity level we expect:
- Tanks
- Space invaders (at least 3 rows of 5 blocks/aliens)
- Simple flash games (ex. http://www.ferryhalim.com/orisinal /)
- Simple Neopets games (http://www.neopets.com/games /)
- Old Atari games, like Asteroids (http://www.freeasteroids.or g)
Tips:
- Start early. Never underestimate how long it takes to make a game!
- Start from scratch. Do not copy your last games code and change it.
- Do not draw text every frame. Text takes a while to draw, so only update it when it needs to be updated (ex: only redraw score when it has changed from the previous frame).
- When splitting code between multiple files, put code that will be useful in multiple games in myLib.c, and code specific to this game in main.c or other files. Those other files should be specific to a concept (collision, etc.).
- Organize your code into functions specific to what that code does. Your main method should not be very long.
- Having update() and draw() functions that you call in main() is helpful.
Make sure the order takes into account waiting for vblank at the correct times to minimize flicker.
- Build upon the myLib.c and myLib.h files from previous assignments. Feel free to reach out to the TAs if you have any questions!