feat(control) 多角色控制

This commit is contained in:
chicrobot committed 2025-12-30 21:45:25 +08:00
1 parent be5ee91328
commit f86e5f3a79
11 files changed
+431

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import Unit from '../objects/Unit.js';
import { InputSystem } from '../systems/InputSystem.js';
import { SelectionSystem } from '../systems/SelectionSystem.js';
import { CommandSystem } from '../systems/CommandSystem.js';
import { VirtualJoystick } from '../ui/VirtualJoystick.js';
export default class GameScene extends Phaser.Scene {
create() {
this.unitGroup = this.add.group();
for (let i = 0; i < 5; i++) {
const unit = new Unit(this, 100 + i * 80, 300, 'player');
this.unitGroup.add(unit);
}
this.inputSystem = new InputSystem(this);
this.selectionSystem = new SelectionSystem(this);
this.commandSystem = new CommandSystem(this);
// 初始化虚拟摇杆
this.virtualJoystick = new VirtualJoystick(this);
}
update() {
this.inputSystem.update();
}
}