Popravek dimenzij in hitboxa za Gronka ter posodobitev assetov
This commit is contained in:
@@ -60,6 +60,13 @@ export default class GrassSceneClean extends Phaser.Scene {
|
||||
this.load.image('campfire', 'DEMO_FAZA1/Environment/taborni_ogenj.png');
|
||||
this.load.image('tent', 'DEMO_FAZA1/Environment/sotor.png');
|
||||
this.load.image('sleeping_bag', 'DEMO_FAZA1/Items/spalna_vreca.png');
|
||||
|
||||
// 7. NEW: Gronk & Structures
|
||||
this.load.spritesheet('gronk', 'DEMO_FAZA1/Characters/gronk_walk_sheet.png', {
|
||||
frameWidth: 256,
|
||||
frameHeight: 256
|
||||
});
|
||||
this.load.image('rain_catcher', 'DEMO_FAZA1/Structures/rain_catcher.png');
|
||||
}
|
||||
|
||||
create() {
|
||||
@@ -132,6 +139,14 @@ export default class GrassSceneClean extends Phaser.Scene {
|
||||
this.clearAmnesia();
|
||||
});
|
||||
|
||||
// --- NEW: RAIN CATCHER ---
|
||||
this.rainCatcher = this.physics.add.image(startX + 150, startY + 50, 'rain_catcher');
|
||||
this.rainCatcher.setScale(0.8);
|
||||
this.rainCatcher.setInteractive({ draggable: true });
|
||||
this.rainCatcher.setDepth(startY + 50); // Y-sort
|
||||
this.rainCatcher.body.setImmovable(true);
|
||||
// Collider added later with Kai
|
||||
|
||||
// General Drag Event
|
||||
this.input.on('drag', function (pointer, gameObject, dragX, dragY) {
|
||||
gameObject.x = dragX;
|
||||
@@ -407,6 +422,34 @@ export default class GrassSceneClean extends Phaser.Scene {
|
||||
// Collider Stream <-> Kai
|
||||
// this.physics.add.collider(this.kai, this.stream);
|
||||
|
||||
// --- NEW: GRONK (NPC) ---
|
||||
this.gronk = this.physics.add.sprite(startX - 150, startY - 100, 'gronk');
|
||||
this.gronk.setScale(0.8); // Gronk is big!
|
||||
this.gronk.setDepth(startY - 100);
|
||||
this.gronk.setImmovable(true);
|
||||
this.gronk.body.setSize(80, 60);
|
||||
this.gronk.body.setOffset(88, 190); // Adjusted for 256x256 frame
|
||||
|
||||
// Gronk Animations
|
||||
this.anims.create({
|
||||
key: 'gronk-idle',
|
||||
frames: this.anims.generateFrameNumbers('gronk', { start: 0, end: 3 }), // Using Down walk as idle for now
|
||||
frameRate: 4,
|
||||
repeat: -1
|
||||
});
|
||||
this.gronk.play('gronk-idle');
|
||||
|
||||
// Interaction (Say Hello)
|
||||
this.gronk.setInteractive();
|
||||
this.gronk.on('pointerdown', () => {
|
||||
console.log("Gronk: 'Ej stari, kje si hodil? Si pozabil, da imava vajo s bendom?'");
|
||||
// Future: Show Dialog Box
|
||||
});
|
||||
|
||||
// Colliders
|
||||
this.physics.add.collider(this.kai, this.rainCatcher);
|
||||
this.physics.add.collider(this.kai, this.gronk);
|
||||
|
||||
// --- ANIMATIONS ---
|
||||
// 0-3: Down, 4-7: Left, 8-11: Right, 12-15: Up
|
||||
this.anims.create({
|
||||
|
||||
Reference in New Issue
Block a user