Has anybody seen a sample of how to use spritesheets with the MatterJS physics engine? I have one for the Arcade physics engine that works fine. But when I try the same code in my new app that uses MatterJS instead, the spritesheet just drops into the game world showing all frames at once (and then falls through the floor).
PRELOAD:
this.load.spritesheet('dude', '/app/dist/dude.png', { frameWidth: 32, frameHeight: 48 });
CREATE
player = this.matter.add.sprite(100, 450, 'dude');
player.setBounce(0.2);
// player.setCollideWorldBounds(true);
this.anims.create({
key: 'left',
frames: this.anims.generateFrameNumbers('dude', { start: 0, end: 3 }),
frameRate: 10,
repeat: -1
});
this.anims.create({
key: 'turn',
frames: [ { key: 'dude', frame: 4 } ],
frameRate: 20
});
this.anims.create({
key: 'right',
frames: this.anims.generateFrameNumbers('dude', { start: 5, end: 8 }),
frameRate: 10,
repeat: -1
});