Enhance character sprite loading and animation handling

- Updated the game to support new character sprite atlases for both male and female characters, allowing for a wider variety of NPC designs.
- Improved player sprite initialization to dynamically select between atlas-based and legacy sprites, enhancing flexibility in character representation.
- Refined collision box settings based on sprite type, ensuring accurate physics interactions for both atlas (80x80) and legacy (64x64) sprites.
- Enhanced NPC behavior to utilize atlas animations, allowing for more fluid and diverse animations based on available frames.

Files modified:
- game.js: Added new character atlases and updated sprite loading logic.
- player.js: Improved player sprite handling and collision box adjustments.
- npc-behavior.js: Updated animation handling for NPCs to support atlas-based animations.
- npc-sprites.js: Enhanced NPC sprite creation to accommodate atlas detection and initial frame selection.
- scenario.json.erb: Updated player and NPC configurations to utilize new sprite sheets and animation settings.
- m01_npc_sarah.ink: Revised dialogue options to include new interactions related to NPCs.
This commit is contained in:
Z. Cliffe Schreuders
2026-02-11 00:18:21 +00:00
parent d1e38bad29
commit fb6e9b603c
54 changed files with 67783 additions and 85 deletions

View File

@@ -59,18 +59,6 @@ Sarah: The office door is usually locked during audits—confidentiality protoco
Sarah: Kevin should be in the IT room. It's through the main office, on the east side.
+ [Where exactly is the IT room?]
-> ask_it_location
+ [Thanks, I'll head in]
-> hub
=== ask_it_location ===
Sarah: Go through the main office, then look for the door marked "IT" on the east wall.
Sarah: The IT room has a keypad lock. Kevin's the one who knows the code.
Sarah: Actually, I think there's a maintenance checklist somewhere in the main office with the codes. Kevin keeps forgetting them.
-> hub
// ================================================
@@ -78,6 +66,8 @@ Sarah: Actually, I think there's a maintenance checklist somewhere in the main o
// ================================================
=== hub ===
+ [Where exactly is the IT room?]
-> ask_it_location
+ {not asked_about_kevin} [Tell me about Kevin]
-> ask_kevin
+ {not asked_about_office} [What's the office layout like?]
@@ -91,6 +81,19 @@ Sarah: Actually, I think there's a maintenance checklist somewhere in the main o
Sarah: Good luck with the audit! Let me know if you need anything.
-> hub
// ================================================
// ASK ABOUT IT LOCATION
// ================================================
=== ask_it_location ===
Sarah: Go through the main office, then look for the door marked "IT" on the east wall.
Sarah: The IT room has a keypad lock. Kevin's the one who knows the code.
Sarah: Actually, I think there's a maintenance checklist somewhere in the main office with the codes. Kevin keeps forgetting them.
-> hub
// ================================================
// ASK ABOUT KEVIN
// ================================================

File diff suppressed because one or more lines are too long

View File

@@ -247,11 +247,11 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"player": {
"id": "player",
"displayName": "Agent 0x00",
"spriteSheet": "hacker",
"spriteSheet": "female_hacker_hood",
"spriteTalk": "assets/characters/hacker-talk.png",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 6,
"walkFrameRate": 12
}
},
@@ -267,10 +267,10 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"displayName": "Agent 0x99",
"npcType": "person",
"position": { "x": 500, "y": 500 },
"spriteSheet": "hacker",
"spriteSheet": "male_spy",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 6,
"walkFrameRate": 10
},
"storyPath": "scenarios/m01_first_contact/ink/m01_opening_briefing.json",
"currentKnot": "start",
@@ -285,11 +285,11 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"displayName": "Sarah Martinez",
"npcType": "person",
"position": { "x": 4, "y": 1.5 },
"spriteSheet": "hacker-red",
"spriteSheet": "female_office_worker",
"spriteTalk": "assets/characters/hacker-red-talk.png",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 2,
"walkFrameRate": 10
},
"storyPath": "scenarios/m01_first_contact/ink/m01_npc_sarah.json",
"currentKnot": "start",
@@ -575,10 +575,10 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"displayName": "Kevin Park",
"npcType": "person",
"position": { "x": 4, "y": 4 },
"spriteSheet": "hacker",
"spriteSheet": "male_nerd",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 6,
"walkFrameRate": 10
},
"storyPath": "scenarios/m01_first_contact/ink/m01_npc_kevin.json",
"currentKnot": "start",
@@ -755,11 +755,11 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"displayName": "Maya Chen",
"npcType": "person",
"position": { "x": 4, "y": 4 },
"spriteSheet": "hacker-red",
"spriteSheet": "female_scientist",
"spriteTalk": "assets/characters/hacker-red-talk.png",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 6,
"walkFrameRate": 10
},
"storyPath": "scenarios/m01_first_contact/ink/m01_npc_maya.json",
"currentKnot": "start"
@@ -801,10 +801,10 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
"displayName": "Derek Lawson",
"npcType": "person",
"position": { "x": 4, "y": 4 },
"spriteSheet": "hacker",
"spriteSheet": "male_security_guard",
"spriteConfig": {
"idleFrameStart": 20,
"idleFrameEnd": 23
"idleFrameRate": 6,
"walkFrameRate": 10
},
"storyPath": "scenarios/m01_first_contact/ink/m01_derek_confrontation.json",
"currentKnot": "start",