Files
CINC/scenes/GameScene.js
T

26 lines
814 B
JavaScript

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();
}
}