Initial commit: Naddie Jump — Monad Edition

This commit is contained in:
2026-05-23 15:33:42 +07:00
commit 7439f8f267
57 changed files with 2765 additions and 0 deletions

23
src/entities/Spring.js Normal file
View File

@@ -0,0 +1,23 @@
import { Physics } from 'phaser';
import { SUPER_JUMP_VELOCITY } from '../config/game.config.js';
export class Spring extends Physics.Arcade.Sprite {
constructor(scene, x, y) {
super(scene, x, y, 'spring');
scene.add.existing(this);
scene.physics.add.existing(this, true);
this.setScale(1);
this.body.setSize(20, 32);
this.active = true;
}
onPlayerTouch(player) {
if (!this.active) return false;
this.active = false;
this.setVisible(false);
this.body.enable = false;
player.jump(SUPER_JUMP_VELOCITY);
return true;
}
}