Skip to content

Commit

Permalink
Fix bug where entities can be permanently stuck.
Browse files Browse the repository at this point in the history
  • Loading branch information
zheng-ze committed Apr 20, 2024
1 parent ad85f8e commit b50dc8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class ArrowTower: BaseTower, PlayerSpawnable {
self.addComponent(ShootingComponent(fireRate: ArrowTower.fireRate,
range: ArrowTower.range,
attackPower: ArrowTower.damage, shootingType: Bullet.self))
self.addComponent(DamageComponent(attackRate: 1,
attackPower: 1,
temporary: false))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class SoldierUnit: BaseUnit, PlayerSpawnable {
self.addComponent(ShootingComponent(fireRate: SoldierUnit.attackRate,
range: SoldierUnit.range,
attackPower: SoldierUnit.attackPower, shootingType: Bullet.self))
self.addComponent(DamageComponent(attackRate: 1,
attackPower: 1,
temporary: false))
}

required init(position: CGPoint, player: Player, id: UUID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class WizardUnit: BaseUnit, PlayerSpawnable {
self.addComponent(ShootingComponent(fireRate: WizardUnit.attackRate,
range: WizardUnit.range,
attackPower: WizardUnit.attackPower, shootingType: WizardBall.self))
self.addComponent(DamageComponent(attackRate: 1,
attackPower: 1,
temporary: false))
}

required init(position: CGPoint, player: Player, id: UUID) {
Expand Down

0 comments on commit b50dc8c

Please sign in to comment.