mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-29 23:31:29 +08:00
feat(control) 多角色控制
This commit is contained in:
1 parent
be5ee91328
commit
f86e5f3a79
11 files changed
+431
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user