mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-11-13 09:38:09 +00:00
Enemy spawners
This commit is contained in:
@@ -6,7 +6,7 @@ import { UnitHealth } from "../UnitHealth";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("Enemy")
|
||||
export class Enemy extends Component implements IDamageDealing {
|
||||
export class Enemy extends Component {
|
||||
@property(BoxCollider2D) public collider: BoxCollider2D;
|
||||
|
||||
private health: UnitHealth = new UnitHealth(1);
|
||||
@@ -15,7 +15,7 @@ export class Enemy extends Component implements IDamageDealing {
|
||||
|
||||
public setup(position: Vec3): void {
|
||||
this.health = new UnitHealth(1);
|
||||
this.speed = randomRange(0.5, 1);
|
||||
this.speed = randomRange(40, 90);
|
||||
this.node.setWorldPosition(position);
|
||||
this.node.active = true;
|
||||
}
|
||||
@@ -51,7 +51,3 @@ export class Enemy extends Component implements IDamageDealing {
|
||||
this.node.setWorldPosition(newPosition);
|
||||
}
|
||||
}
|
||||
|
||||
export interface IDamageDealing {
|
||||
Damage: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user