In this recipe we are going to look at playing an animation sequence using the sprite sheet we just created in the prior recipe.
This recipe assumes you have completed the Creating a sprite sheet recipe or have a sprite sheet acquired from another source. Make sure your sprite sheet is composed of sprites of an identical size. In this example, our sheet is 2 rows of 4 columns of sprites, with the bottom-right sprite being empty, for a total of seven sprites.
Create a new project, and then add a reference to GameEngine2D.
In
AppMain.cs
replace the existing code with the following code:using System; using Sce.PlayStation.Core; using Sce.PlayStation.HighLevel.GameEngine2D; namespace Ch3_Example4 { public class AppMain { public static void Main (string[] args) { Director.Initialize(); SpritesheetScene scene = new SpritesheetScene(); Director.Instance.RunWithScene(scene); } } }
Now add a new file of type...