Popravek dimenzij in hitboxa za Gronka ter posodobitev assetov
This commit is contained in:
BIN
nova farma TRAE/.DS_Store
vendored
BIN
nova farma TRAE/.DS_Store
vendored
Binary file not shown.
BIN
nova farma TRAE/assets/.DS_Store
vendored
BIN
nova farma TRAE/assets/.DS_Store
vendored
Binary file not shown.
BIN
nova farma TRAE/assets/DEMO_FAZA1/.DS_Store
vendored
BIN
nova farma TRAE/assets/DEMO_FAZA1/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
nova farma TRAE/assets/DEMO_FAZA1/Structures/rain_catcher.png
Normal file
BIN
nova farma TRAE/assets/DEMO_FAZA1/Structures/rain_catcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -60,6 +60,13 @@ export default class GrassSceneClean extends Phaser.Scene {
|
|||||||
this.load.image('campfire', 'DEMO_FAZA1/Environment/taborni_ogenj.png');
|
this.load.image('campfire', 'DEMO_FAZA1/Environment/taborni_ogenj.png');
|
||||||
this.load.image('tent', 'DEMO_FAZA1/Environment/sotor.png');
|
this.load.image('tent', 'DEMO_FAZA1/Environment/sotor.png');
|
||||||
this.load.image('sleeping_bag', 'DEMO_FAZA1/Items/spalna_vreca.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() {
|
create() {
|
||||||
@@ -132,6 +139,14 @@ export default class GrassSceneClean extends Phaser.Scene {
|
|||||||
this.clearAmnesia();
|
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
|
// General Drag Event
|
||||||
this.input.on('drag', function (pointer, gameObject, dragX, dragY) {
|
this.input.on('drag', function (pointer, gameObject, dragX, dragY) {
|
||||||
gameObject.x = dragX;
|
gameObject.x = dragX;
|
||||||
@@ -407,6 +422,34 @@ export default class GrassSceneClean extends Phaser.Scene {
|
|||||||
// Collider Stream <-> Kai
|
// Collider Stream <-> Kai
|
||||||
// this.physics.add.collider(this.kai, this.stream);
|
// 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 ---
|
// --- ANIMATIONS ---
|
||||||
// 0-3: Down, 4-7: Left, 8-11: Right, 12-15: Up
|
// 0-3: Down, 4-7: Left, 8-11: Right, 12-15: Up
|
||||||
this.anims.create({
|
this.anims.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user