Slash-The-Hordes/assets/Scripts/GameBootstrapper.ts

21 lines
645 B
TypeScript
Raw Normal View History

2022-11-03 15:55:49 +00:00
import { Component, _decorator } from "cc";
import { Player } from "./Player";
import { VirtualJoystic } from "./VirtualJoystic";
const { ccclass, property } = _decorator;
@ccclass("GameBootstrapper")
export class GameBootstrapper extends Component {
@property(VirtualJoystic) private virtualJoystic: VirtualJoystic;
@property(Player) private player: Player;
@property(Number) private strikeDelay = 0;
public start(): void {
this.virtualJoystic.init();
this.player.init(this.virtualJoystic, this.strikeDelay);
}
public update(deltaTime: number): void {
this.player.gameTick(deltaTime);
}
}