preload() { // Load Town this.load.image("TilesTown", TilesTown); this.load.tilemapTiledJSON("town", TownJSON); // Load Route1 this.load.tilemapTiledJSON("route1", Route1JSON); // Load atlas this.load.atlas("currentPlayer", AtlasPNG, AtlasJSON); this.load.atlas("players", PlayersAtlasPNG, PlayersAtlasJSON); }
it('should multiply to 528 (24*22)', done => { class MainScene extends Phaser.Scene { preload() { this.load.image('star', '../assets/star.png') } create() { const star = this.physics.add.sprite(400, 300, 'star') expect(star.body.width * star.body.height).toBe(528) done() } } StartTest([MainScene]) })
class MainScene extends Phaser.Scene { preload() { this.load.image('tiles', '../assets/gridtiles.png') this.load.tilemapTiledJSON('map', '../assets/simple-map.json')