Commit ded87dfe authored by Yannick Armand's avatar Yannick Armand

Les balles font des dégâts aux barils explosifs

parent b18cb72d
......@@ -13,7 +13,13 @@ import Rocket from './weapon/projectile/Rocket'
import SmokeGrenade from './weapon/projectile/SmokeGrenade'
class Collision {
public static onBulletOverlapsBlock(bullet: Bullet, block: Block): void {
public static onBulletOverlapsBarrel(bullet: Bullet, barrel: Barrel): void {
barrel.decreaseHealth(bullet.getDamages())
bullet.remove()
}
public static onBulletOverlapsCrate(bullet: Bullet, crate: Crate): void {
bullet.remove()
}
......@@ -68,8 +74,8 @@ const collisions: { [key: string]: { [key: string]: (e1: any, e2: any) => void }
},
[Bullet.name]: {
[Barrel.name]: Collision.onBulletOverlapsBlock,
[Crate.name]: Collision.onBulletOverlapsBlock,
[Barrel.name]: Collision.onBulletOverlapsBarrel,
[Crate.name]: Collision.onBulletOverlapsCrate,
[BlockDynamite.name]: Collision.onProjectileOverlapsMine,
[BlockMine.name]: Collision.onProjectileOverlapsMine,
[Player.name]: Collision.onBulletOverlapsPlayer,
......
......@@ -2,7 +2,7 @@ import Explosion from '../Explosion'
import Game from '../Game'
import Block from './Block'
const BASE_HEALTH = 120
const BASE_HEALTH = 240
export default class Barrel extends Block {
private health: number
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment