[Solved] CS2261 LAB7-Sprites

$25

File Name: CS2261_LAB7-Sprites.zip
File Size: 178.98 KB

SKU: [Solved] CS2261 LAB7-Sprites Category: Tag:
5/5 - (1 vote)

In this lab, you will be completing several different TODOs, which will, piece by piece,complete an animated goomba character that the player can control. This lab will providesignificantly more detail in the comments of the code, so READ VERY CAREFULLY. Yourcode may not compile until you complete an entire TODO block, at which point the gameshould compile with a new component of the final outcome (unless otherwise specified).Note: Make sure to copy over your Makefile and .vscode/tasks.json from one of yourprevious assignments.TODO 1.0 Loading and Enabling SpritesLets set up sprites!CS 2261 Spring 2021 TODO 1.0 In main.c, #include spritesheet.h TODO 1.1 In initialize(), load the spritesheet palette and tiles into their desired spacesin memory HINT: The sprite palette is different from the background palette(check myLib.h) HINT: Which charblock do sprite tiles go in? TODO 1.2 In myLib.c, complete hideSprites() In main.c, uncomment the hideSprites() call TODO 1.3 In initialize(), enable sprites Build and run. You should not see anything new. If you see anything in the top-left(CORNERFACE), fix this before going further.TODO 2.0 At the bottom of initialize(), READ CAREFULLY all of the animation variables for thegoomba player Look back at the spritesheet to see how it is organizedTODO 2.1 2.9 Animating SpritesLets get the goomba showing and its animations working! TODO 2.1 If the sprite is not idle: Set the previous state to the current state Then reset the goombas state to idle TODO 2.2 Increment the goombas current frame HINT: there are only numFrames number of frames, and the frames of theanimation must end up LOOPING TODO 2.3 2.6 Set the goombas aniState accordingly TODO 2.7 If the goomba is idle: We want the current frame to be of the goomba standing (frame 0) inwhatever direction he was last facing (current state set to theprevious state) Else: Increment the animation counter TODO 2.8CS 2261 Spring 2021 Set up all of the sprite attributes, place the sprite at index 0 of theshadowOAM Look at myLib.h for sprite stuff! Hint: Open up spritesheet.bmp and look at how the sprites are organized.Animation states correspond to columns, and frames are the rows of thespritesheet Hint: this sprite is 32 x 32, you are going to need to do some multiplicationwhen setting up ATTR2 TILEID Each tile is 88 When the goomba is idle, where does that correspond to on thespritesheet? (0,0) because the sprite begins at tile 0,0 and takes up 4tiles wide and 4 tiles tall TODO 2.9 Copy the shadowOAM into the OAM HINT: how many sprites can we have in the OAM? How many attributes doeseach sprite have? Build and run. You should be able to walk the player goomba around, see thebackground repeat and all while the player is at the bottom-center of thescreen. If this is not the case, fix this before moving forwardTODO 3.0 At the bottom of initialize(), READ CAREFULLY all of the animation variables for theflowers Look back at the spritesheet to see how it is organizedTODO 3.1 3.9 Animating Multiple SpritesLets get multiple flowers showing and animating! These sprites will all be doing the sameanimation (a single state) and it will be continuously looping, so no need to worry aboutchecking for button inputs here! TODO 3.1 Increment each flowers current frame of animation every 12 frames ofgameplay You will also need to increment each flowers aniCounter Refer to the code associated with TODO 2.2 for how to check for frames ofgameplay HINT: there are only numFrames number of frames, and the frames of theanimation must end up LOOPING TODO 3.2 Loop through each flower and set up all of the sprite attributes BE CAREFUL when placing the sprites in the shadowOAM as to notoverwrite where the player sprite is (shadowOAM[0]) Since we only have a single state for our flowers, its col value ofCS 2261 Spring 2021TILEID will not change. However, now we are startingfrom lower in the spritesheet, so we will need to add the starting tilerow (12) to our curFrame value calculation Look at myLib.h for sprite stuff! Hint: Open up spritesheet.bmp and look at how the sprites are organized.Animation states correspond to columns, and frames are the rows of thespritesheet Hint: this sprite is 16 x 16, you are going to need to do some multiplicationwhen setting up ATTR2 TILEID for the curFrame Each tile is 88 Where does the flower sprite start in the spritesheet? (0,12) in tiles.This location is the first frame of our flower The sprite takes up 2 tiles wide and 2 tiles tall TODO 3.3 Build and run. You should now see 4 flowers at the bottom of the screen,continuously moving up and down slightly and shining. They should followthe player, stuck at the bottom of the screen as the player goomba moves.You will know if it runs correctly if: You can walk the player around infinitely See your background repeat while the goomba stays in the middle/bottom of thescreen See the four flowers at the bottom of the screen continuously animate You DO NOT see corner faceTips Follow each TODO in order, and only move forward if everything is correct

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS2261 LAB7-Sprites
$25