Commit 7191bb15 authored by Yannick Armand's avatar Yannick Armand

Trainée de particules derrière le lancer de bazooka

parent 706767da
import Game from '../../Game'
import Particle from '../../Particle'
import Projectile from './Projectile'
export default class Rocket extends Projectile {
......@@ -13,6 +14,24 @@ export default class Rocket extends Projectile {
.setImage(image)
}
public update(dt: number) {
super.update(dt)
const particle = new Particle(this.getGame())
.setPosition(this.getCenter().clone())
.setSpeed(20, 40)
.setLifetime(0.4, 0.6)
.setRadius(1, 3)
.setAngle(0, 360)
.setColor([
'rgb(255, 140, 0)',
'rgb(200, 100, 0)',
'rgb(160, 60, 0)',
])
this.getGame().addParticle(particle)
}
public explode(): void {
// @todo Effectuer l'explosion
......
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