mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-26 03:38:58 +00:00
21 lines
645 B
TypeScript
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);
|
|
}
|
|
}
|