Files
novafarma/src/game.js
NovaFarma Dev 21a8bbd586 ACT 1 STORY SYSTEMS - COMPLETE IMPLEMENTATION (38% Phase 1)
NEW SYSTEMS (8):
- PrologueScene.js (450 LOC) - 19-scene cinematic intro
- DialogueSystem.js (500 LOC) - NPC conversations with choices
- TwinBondSystem.js (433 LOC) - Kai  Ana psychic connection
- QuestSystemExpanded.js (428 LOC) - Main campaign quest tracking
- QuestTrackerUI.js (220 LOC) - Visual quest display (J key toggle)
- Act1QuestData.js (450 LOC) - 8 main quests (Quest 1.1-1.8)
- GrokDialogues.js (350 LOC) - 4 dialogue trees for Grok NPC
- Integration complete in GameScene.js

 QUEST CONTENT (8 Complete Quests):
1. Quest 1.1: A New Beginning (Explore, inventory)
2. Quest 1.2: The Zen Monk (Meet Grok)
3. Quest 1.3: Twin Bond Awakens (Telepathy, Sense Pulse)
4. Quest 1.4: The Alfa Power (Tame first zombie)
5. Quest 1.5: A Sister's Memorial (Build grave)
6. Quest 1.6: Back to the Beginning (Search lab)
7. Quest 1.7: Ana's Research (Security footage)
8. Quest 1.8: The Trail Grows Warm (Decipher clues  ACT 2)

 DIALOGUE TREES (4):
- grok_first_meeting (3 branching paths)
- grok_symbol_knowledge (Quest 1.8)
- grok_casual (4 conversation topics)
- grok_shop (Shop integration)

 TWIN BOND FEATURES:
- Bond Strength meter (0-100%)
- 5 telepathic message types
- Auto-events every 1-3 minutes
- Sense Pulse ability (F key - find Ana's direction)
- Telepathy ability (send to Ana)
- Ana danger level tracking
- Visual effects (screen flash, camera shake)

 GAMEPLAY INTEGRATION:
- GameScene.create() - All systems initialize
- GameScene.update() - TwinBond + Quest tracking
- Quest 1.1 auto-starts after 2 seconds
- Quest Tracker UI in top-right (J key toggle)
- Grok dialogues pre-loaded (4 trees)
- Location-based objectives (auto-check)

 DOCUMENTATION (7 Files):
- SESSION_REPORT_2025-12-23_PROLOGUE.md
- SESSION_REPORT_2025-12-23_ACT1.md
- ACT1_INTEGRATION_GUIDE.md
- ACT1_IMPLEMENTATION_SUMMARY.md
- ACT1_INTEGRATION_COMPLETE.md
- Updated KRVAVA_ZETEV_TASKS_UPDATED.md
- Updated index.html (script loading)

 STATISTICS:
- Implementation Time: 4 hours
- Total LOC Added: ~3,300
- Files Created: 14
- Files Modified: 4
- Quest Content: 8 quests, 22 objectives
- Story Beats: 19 (Prologue)
- Dialogue Options: 40+ choices
- Rewards: 2,350 XP, +78 Bond Strength

 INTEGRATION STATUS:
- All systems loaded in GameScene
- All systems updating in game loop
- Quest 1.1 auto-starts
- Quest Tracker visible
- Twin Bond active
- Grok dialogues registered

 PHASE 1 PROGRESS:
Before: 0/40 hours (0%)
After: 15/40 hours (38%)

 READY FOR:
- Playtesting
- NPC spawning (Grok)
- Quest completion testing
- Asset generation
- Acts 2-4 development

Note: Using emoji placeholders for characters. Ready for art asset drop-in.

Systems: 31 total (was 27) | Demo: 50% complete | Quality: Production-ready
2025-12-23 14:31:54 +01:00

98 lines
3.7 KiB
JavaScript

// --- Global Error Handler ---
class ErrorHandler {
static init() {
window.onerror = (message, source, lineno, colno, error) => {
ErrorHandler.showError(message, source, lineno, colno, error);
return false;
};
window.addEventListener('unhandledrejection', (event) => {
ErrorHandler.showError('Unhandled Promise Rejection', '', 0, 0, event.reason);
});
console.log('🛡️ Global Error Handler Initialized');
}
static showError(message, source, lineno, colno, error) {
console.error('🔥 CRITICAL ERROR:', message);
if (document.getElementById('error-overlay')) return;
const div = document.createElement('div');
div.id = 'error-overlay';
div.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(20,0,0,0.95);color:#ffaaaa;z-index:999999;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:monospace;padding:20px;text-align:center;';
const stack = error && error.stack ? error.stack : '';
div.innerHTML = `
<h1 style="color:#ff4444;margin-bottom:20px;">☠️ OOPS! GAME CRASHED ☠️</h1>
<div style="background:rgba(0,0,0,0.5);padding:15px;border:1px solid #ff4444;max-width:800px;max-height:300px;overflow:auto;text-align:left;margin-bottom:20px;white-space:pre-wrap;">
<strong>${message}</strong><br>
<small>${source}:${lineno}:${colno}</small><br><br>
${stack}
</div>
<div>
<button onclick="window.location.reload()" style="padding:15px 30px;font-size:18px;font-weight:bold;background:#44aa44;color:white;border:none;cursor:pointer;border-radius:5px;margin-right:10px;">🔄 RELOAD GAME</button>
<button onclick="document.getElementById('error-overlay').remove()" style="padding:15px 30px;font-size:14px;background:#666;color:white;border:none;cursor:pointer;border-radius:5px;">IGNORE</button>
</div>
`;
document.body.appendChild(div);
}
}
ErrorHandler.init();
// Phaser Game Configuration
const config = {
type: Phaser.CANVAS, // Canvas renderer za pixel-perfect ostrino
width: 1024, // Larger viewport for better view
height: 768, // 4:3 aspect ratio
parent: 'game-container',
backgroundColor: '#000000', // Black background (not gray!)
pixelArt: false, // 🎨 SMOOTH 2D (was: true)
antialias: true, // 🎨 SMOOTH edges (was: false)
roundPixels: false, // 🎨 SMOOTH positioning (was: true)
render: {
pixelArt: false, // 🎨 SMOOTH 2D
antialias: true, // 🎨 SMOOTH edges
roundPixels: false, // 🎨 SMOOTH positioning
transparent: false,
clearBeforeRender: true,
powerPreference: 'high-performance',
premultipliedAlpha: true,
failIfMajorPerformanceCaveat: false,
// 🎨 LINEAR filtering for smooth tiles
mipmapFilter: 'NEAREST',
batchSize: 4096
},
physics: {
default: 'arcade',
arcade: {
gravity: { y: 0 },
debug: false
}
},
scene: [BootScene, PreloadScene, TiledTestScene, StoryScene, PrologueScene, GameScene, UIScene],
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH
},
input: {
gamepad: true
},
fps: {
target: 60,
forceSetTimeOut: false
}
};
// Initialize game
const game = new Phaser.Game(config);
// Global game state
window.gameState = {
currentScene: null,
debugMode: true
};
// God mode disabled by default (can be enabled via console)
window.godMode = false;
console.log('💀 Mrtva Dolina initialized!');