Packer !full! | Phaser Texture
Leo realized he couldn't just add the sprite by image name anymore. He had to refer to the frames inside the atlas. He checked his JSON file and saw that the Texture Packer had preserved the original filenames as "frame" keys.
50 files → 50 requests. After: 1 atlas file + 1 JSON file → 2 requests. phaser texture packer
// Create a sprite from the "hero_idle_01" frame stored in the atlas let player = this.add.sprite(400, 300, 'game-sprites', 'hero_idle_01'); Leo realized he couldn't just add the sprite
this.player.play('run'); }
In the bustling digital kingdom of Browsernia , there lived a Junior Developer named Leo. Leo was building his magnum opus: a side-scrolling adventure game called Cyber-Knight . 50 files → 50 requests
Leo loved his sprites. He had a sprite for the Knight running, jumping, idle, attacking, and even one for the Knight tripping over a cyber-cat. He had 50 unique frames of animation, and in his innocence, he saved them as 50 separate .png files: knight1.png , knight2.png , and so on.