FAZA 0: Initial project setup - Electron + Phaser configuration

This commit is contained in:
2025-12-06 17:47:56 +01:00
commit cdcd7f8bc6
9 changed files with 502 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
// Preload Scene - Nalaganje assetov
class PreloadScene extends Phaser.Scene {
constructor() {
super({ key: 'PreloadScene' });
}
preload() {
console.log('📦 PreloadScene: Loading assets...');
// TODO: Tu bomo nalagali sprite-e, tile-e, audio, itd.
// Za fazo 0 pustimo prazno - samo testiramo osnovni setup
}
create() {
console.log('✅ PreloadScene: Assets loaded!');
window.gameState.currentScene = 'PreloadScene';
// Prikaz začetnega sporočila
const width = this.cameras.main.width;
const height = this.cameras.main.height;
const title = this.add.text(width / 2, height / 2 - 50, 'NOVAFARMA', {
fontFamily: 'Courier New',
fontSize: '48px',
fill: '#00ff41',
fontStyle: 'bold'
});
title.setOrigin(0.5);
const subtitle = this.add.text(width / 2, height / 2 + 10, '2.5D Isometric Survival Game', {
fontFamily: 'Courier New',
fontSize: '20px',
fill: '#ffffff'
});
subtitle.setOrigin(0.5);
const instruction = this.add.text(width / 2, height / 2 + 60, 'Press SPACE to start', {
fontFamily: 'Courier New',
fontSize: '16px',
fill: '#888888'
});
instruction.setOrigin(0.5);
// Blinking effect
this.tweens.add({
targets: instruction,
alpha: 0.3,
duration: 800,
yoyo: true,
repeat: -1
});
// Pritisk SPACE za začetek igre
this.input.keyboard.once('keydown-SPACE', () => {
console.log('🎮 Starting GameScene...');
this.scene.start('GameScene');
});
}
}