FAZA 17: 2.5D Minecraft-Style Terrain + Y-Layer Stacking + Custom Sprites

COMPLETED FEATURES:

 Custom Sprite Integration:
- Player, Zombie, Merchant sprites (0.2 scale)
- 11 custom sprites + 5 asset packs loaded
- Auto-transparency processing (white/brown removal)
- Gravestone system with atlas extraction

 2.5D Minecraft-Style Terrain:
- Volumetric blocks with 25px thickness
- Strong left/right side shading (30%/50% darker)
- Minecraft-style texture patterns (grass, dirt, stone)
- Crisp black outlines for definition

 Y-Layer Stacking System:
- GRASS_FULL: All green (elevation > 0.7)
- GRASS_TOP: Green top + brown sides (elevation 0.4-0.7)
- DIRT: All brown (elevation < 0.4)
- Dynamic terrain depth based on height

 Floating Island World Edge:
- Stone cliff walls at map borders
- 2-tile transition zone
- Elevation flattening for cliff drop-off effect
- 100x100 world with defined boundaries

 Performance & Polish:
- Canvas renderer for pixel-perfect sharpness
- CSS image-rendering: crisp-edges
- willReadFrequently optimization
- No Canvas2D warnings

 Technical:
- 3D volumetric trees and rocks
- Hybrid rendering (2.5D terrain + 2D characters)
- Procedural texture generation
- Y-layer aware terrain type selection
This commit is contained in:
2025-12-07 01:44:16 +01:00
parent 34a2d07538
commit 9eb57ed117
60 changed files with 5082 additions and 195 deletions

70
src/scenes/StoryScene.js Normal file
View File

@@ -0,0 +1,70 @@
class StoryScene extends Phaser.Scene {
constructor() {
super({ key: 'StoryScene' });
}
create() {
const width = this.cameras.main.width;
const height = this.cameras.main.height;
// Black background
this.add.rectangle(0, 0, width, height, 0x000000).setOrigin(0);
const storyText =
`Leto 2084.
Svet, kot smo ga poznali, je izginil.
Virus "Zmaj-Volka" je spremenil človeštvo.
Mesta so ruševine. Narava je divja.
Toda ti si drugačen.
Preživel si napad. Okužen, a imun.
Si HIBRID.
Zombiji te ne napadajo... čutijo te.
Zanje si ALFA.
Tvoja naloga:
1. Najdi izgubljeno sestro.
2. Maščuj starše.
3. Obnovi civilizacijo iz pepela.
Dobrodošel v KRVAVI ŽETVI.`;
const textObj = this.add.text(width / 2, height + 100, storyText, {
fontFamily: 'Courier New',
fontSize: '24px',
fill: '#00ff41',
align: 'center',
lineSpacing: 10
});
textObj.setOrigin(0.5, 0);
// Scroll animation
this.tweens.add({
targets: textObj,
y: 50,
duration: 10000, // 10s scroll
ease: 'Linear',
onComplete: () => {
this.time.delayedCall(2000, () => {
this.scene.start('GameScene');
});
}
});
// Skip instructions
const skip = this.add.text(width - 20, height - 20, '[SPACE] Skip', {
fontSize: '16px', fill: '#666'
}).setOrigin(1);
// Input to skip
this.input.keyboard.on('keydown-SPACE', () => {
this.scene.start('GameScene');
});
this.input.on('pointerdown', () => {
this.scene.start('GameScene');
});
}
}