新增基础实体系统
This commit is contained in:
25
demo/src/game/SpawnerComponent.ts
Normal file
25
demo/src/game/SpawnerComponent.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
class SpawnComponent extends Component {
|
||||
public cooldown = -1;
|
||||
public minInterval = 2;
|
||||
public maxInterval = 60;
|
||||
public enemyType = EnemyType.worm;
|
||||
public numSpawned = 0;
|
||||
public numAlive = 0;
|
||||
|
||||
constructor(enemyType: EnemyType) {
|
||||
super();
|
||||
this.enemyType = enemyType;
|
||||
}
|
||||
|
||||
public initialize() {
|
||||
// console.log("initialize");
|
||||
}
|
||||
|
||||
public update() {
|
||||
// console.log("update");
|
||||
}
|
||||
}
|
||||
|
||||
enum EnemyType {
|
||||
worm
|
||||
}
|
||||
Reference in New Issue
Block a user