Spritesheets with 2d array of sprites

Recommended Posts

Apologies if newbies ask this all the time, but I'm new to Phaser and don't know what to search for.

I want to make a spritesheet with m rows and n columns, where every sprite on the top row is the first cell of an animation that plays when the sprite is at that orientation. So if I have a sprite sheet that is 5 cells across and 3 cells deep, I want the middle top cell to represent a spaceship when it is facing forward with cell 1 of the animation of the spaceship jets, then the middle middle cell is the spaceship facing forward with cell 2 of the spaceship jets animation, and the middle bottom cell is the last cell of the spaceship jets animation. How do I tell phaser to loop through these cells on the spritesheet when no key is pressed? The left turn animation is similar - how do I tell phaser to loop through 3 cells of left turn animation in the 2d spritesheet plane?

Is there any speed advantage to having sequential animation cells next to eachother, or does it not matter so I could place all the animation cells in a line on the spritesheet and display any of them whenever?

(The spritesheet attached isn't finished, but you can imagine)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.