Slash-The-Hordes/assets/Scripts/GameBootstrapper.ts
2022-11-03 16:55:49 +01:00

21 lines
645 B
TypeScript

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