In this lab, you will be completing several different TODOs, which will, piece by piece, complete an animated pikachu character that the player can control. Your code may not compile until you complete an entire TODO block, at which point the game should compile with a new component of the final outcome (unless otherwise specified).
TODO 1 Exporting the tiles
We need to export the backgrounds and tiles in order to use them in the code.
- 0: Open bg.bmp in Usenti.
- TODO 1.1: Go to Image > Export, keep the default name, and make sure the type is GBA Source. Make sure it is exporting them to your Lab08 folder.
- TODO 1.2: In the Export popup, make sure the type is 4bpp tiles, and make sure that Pal is checked and Map is checked, because this is a background.
- 3: Open sprite sheet.bmp in Usenti.
- TODO 1.4: Go to Image > Export, keep the default name, and make sure the type is GBA Source. Make sure it is exporting them to your Lab08 folder.
- TODO 1.5: In the Export popup, make sure the type is 4bpp tiles, and make sure that Pal is checked and Map is not checked, because this is a spritesheet.
- TODO 1.6: Add the new .c files to your Makefile.
At this point, we havent added them to your code, so compiling will not do anything useful.
TODO 2 Displaying the Background
We want to be able to actually see the background, so lets set that up.
From now on, the TODOs will have their description in the code. Their location in the file will be listed here.
- 0: Top of main.c.
- 1: main.c, initialize() function.
- 2: main.c, initialize() function, under REG_DISPCTL. Compile and run. You should see the background on the screen. If not, then you either exported wrong or did not load the tiles or map into memory correctly. Fix this before continuing.
TODO 3 Loading and Enabling Sprites Lets get sprites working.
- 0: main.c, initialize() function.
- 1: myLib.c, hideSprites() function.
- 2: main.c, initialize() function
Compile and run. You should not see anything new. If you see anything in the top-left (CORNERFACE), fix this before going further.
TODO 4 Animating Sprites
Lets show pikachu, and get animations working.
- 0: main.c, bottom of initialize() function.
- 1-4.9: main.c, in the main while loop.
Compile and run. You should be able to walk pikachu around infinitely, see your background repeat, and all the while pikachu stays in the middle of the screen. If this all works, submit your lab.
Reviews
There are no reviews yet.