Added support for 16 new PixelLab character sprite sheets with JSON atlas format, while maintaining backward compatibility with existing legacy sprites.
- 16 PixelLab characters added to
public/break_escape/assets/characters/ - Each character includes:
- PNG sprite sheet (80x80 frames, optimized layout)
- JSON atlas with animation metadata
- 8-directional animations (breathing-idle, walk, attack, etc.)
- Added atlas loading for all 16 new characters
- Legacy sprite loading preserved for backward compatibility
- Female characters: 8 variants (hacker, office worker, security, etc.)
- Male characters: 8 variants (hacker, office worker, security, etc.)
- New:
setupAtlasAnimations()function for atlas-based sprites - Automatic format detection (atlas vs. legacy)
- Direction mapping: atlas directions → game directions
- east/west/north/south → right/left/up/down
- Diagonal directions fully supported
- Animation type mapping: breathing-idle, walk, cross-punch, etc.
- Backward compatible with existing frame-based sprites
Updated all characters to use new atlas sprites:
- Player (Agent 0x00):
hacker→female_hacker_hood - Agent 0x99:
hacker→male_spy - Sarah Martinez:
hacker-red→female_office_worker - Kevin Park:
hacker→male_nerd - Maya Chen:
hacker-red→female_scientist - Derek Lawson:
hacker→male_security_guard
Configuration format updated:
// Old format
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
}
// New format
"spriteConfig": {
"idleFrameRate": 8,
"walkFrameRate": 10
}docs/SPRITE_SYSTEM.md- Complete sprite system documentationpublic/break_escape/assets/characters/README.md- Character reference guidepublic/break_escape/assets/characters/SPRITE_SHEETS_SUMMARY.md- Detailed character breakdowntools/README_SPRITE_CONVERTER.md- Conversion tool documentation
tools/convert_pixellab_to_spritesheet.py- Automated sprite sheet generator- Converts PixelLab exports to Phaser-ready atlases
- Generates optimized PNG + JSON for each character
- Updated to skip example JS files
- ✅ 16 HTTP requests instead of 2500+ individual images
- ✅ Single GPU texture per character
- ✅ Faster frame switching (no texture swaps)
- ✅ Optimized memory usage
- ✅ 8-directional movement with smooth animations
- ✅ Multiple animation types per character
- ✅ Easy character variety without custom sprite work
- ✅ Backward compatible with existing sprites
- ✅ Simple configuration in scenario JSON
- ✅ Automatic animation setup
- ✅ Clear character naming (female_hacker, male_spy, etc.)
- ✅ Comprehensive documentation
None - The system is fully backward compatible. Legacy sprites continue to work with the old configuration format.
female_hacker_hood- Hacker in hoodie (hood up)female_hacker- Hacker in hoodiefemale_office_worker- Office worker (blonde)female_security_guard- Security guardfemale_telecom- Telecom workerfemale_spy- Spy in trench coatfemale_scientist- Scientist in lab coatwoman_bow- Woman with bow
male_hacker_hood- Hacker in hoodie (obscured)male_hacker- Hacker in hoodiemale_office_worker- Office worker (shirt & tie)male_security_guard- Security guardmale_telecom- Telecom workermale_spy- Spy in trench coatmale_scientist- Mad scientistmale_nerd- Nerd (glasses, red shirt)
All atlas characters include:
- breathing-idle - 8 directions, 4 frames each
- walk - 8 directions, 6 frames each
- cross-punch - 8 directions, 6 frames each
- lead-jab - 8 directions, 3 frames each
- falling-back-death - 7 frames (some: 8 directions)
- taking-punch - 6 frames (select characters)
- pull-heavy-object - 6 frames (select characters)
{
"id": "my_npc",
"displayName": "My Character",
"npcType": "person",
"position": { "x": 5, "y": 3 },
"spriteSheet": "female_scientist",
"spriteTalk": "assets/characters/scientist-talk.png",
"spriteConfig": {
"idleFrameRate": 8,
"walkFrameRate": 10
}
}To update existing NPCs:
- Choose appropriate character from available list
- Update
spriteSheetvalue - Replace
idleFrameStart/EndwithidleFrameRate - Add
walkFrameRateif needed
Tested with M01 First Contact scenario:
- ✅ All characters load correctly
- ✅ 8-directional movement works
- ✅ Idle animations play properly
- ✅ Walk animations transition smoothly
- ✅ Legacy sprites still functional
- ✅ Performance improved (fewer HTTP requests)
Potential improvements:
- Dynamic portrait generation from sprite sheets
- Character customization system
- Animation state transitions (idle → walk → attack)
- More character variants (uniforms, outfits)
- Custom color tinting for sprite variations
public/break_escape/js/core/game.js- Added atlas loadingpublic/break_escape/js/systems/npc-sprites.js- Added atlas animation support
scenarios/m01_first_contact/scenario.json.erb- Updated all character sprites
public/break_escape/assets/characters/- Added 16 characters (32 files: PNG + JSON)
docs/SPRITE_SYSTEM.md- New comprehensive guidepublic/break_escape/assets/characters/README.md- Character referencepublic/break_escape/assets/characters/SPRITE_SHEETS_SUMMARY.md- Detailed breakdown
tools/convert_pixellab_to_spritesheet.py- Updated (removed example JS generation)tools/README_SPRITE_CONVERTER.md- Updated documentation
- Legacy
hackerandhacker-redsprites remain available spriteTalkimages are separate and work with both formats- Atlas JSON format is Phaser 3 compatible (JSON Hash)
- All frames are 80x80 pixels (vs 64x64 for legacy)
- 2px padding between frames prevents texture bleeding