Time for action – modifying the game to use spritesheets
Now that we've generated the spritesheet, let's modify our Cocohunt game to use it instead of the single sprites by performing the following steps:
Let's remove the
Birds
and theHunter
groups with all their contents from theResources
group in Xcode.Tip
You can either right-click on the group and select Delete or just select the group(s) and press the delete key on the keyboard.
In the remove dialog, you can select Move to Trash, as we're not going to use those images anymore.
After removing the images, let's add our spritesheet. Create a new group inside the
Resources
group and call itSpritesheets
.Open the folder with the files that you've published from TexturePacker and add the following files to the
Spritesheets
group by dragging them into this group as usual. You'll need to add the following files:Cocohunt.plist
Cocohunt.png
Cocohunt-hd.plist
Cocohunt-hd.png
Tip
If, for some reason, you don't have the files generated in TexturePacker...