I have a 48x16 pixel sprite sheet. Each with 16x16 frames. I want to change these frames and create an animation by going through these 3 frames each lasting a different amount of time.
Here are important bits of my code:
function preload() {
this.load.spritesheet('player', 'assets/player-sheet.png', {frameWidth: 16, frameHeight: 16});
}
function create() {
let player = [];
player.x = 400;
player.y = 300;
player.sprite = this.physics.add.sprite(player.x, player.y, 'player', 0);
player.sprite.setScale(4);
player.sprite.smoothed = false;
}
Thank You In Advance!