Skip to content
Snippets Groups Projects
Commit 5d666d0b authored by Rayane Belguebli's avatar Rayane Belguebli
Browse files

correct deplacement enemis

parent ecba4f84
No related branches found
No related tags found
No related merge requests found
...@@ -12,11 +12,14 @@ export default class enemi extends Entite { ...@@ -12,11 +12,14 @@ export default class enemi extends Entite {
constructor(x, y, image, difficulté) { constructor(x, y, image, difficulté) {
super(x, y, new Hitbox(50 / 2, 66, x, y), image); super(x, y, new Hitbox(50 / 2, 66, x, y), image);
if (difficulté == 1) { if (difficulté == 1) {
this.vx = 3;
this.vy = 0;
this.hitbox = new Hitbox(69 / 2, 57, this.x, this.y); this.hitbox = new Hitbox(69 / 2, 57, this.x, this.y);
} else if (difficulté == 2) {
this.vx = 5;
this.vy = 1;
} }
this.difficulté = difficulté; this.difficulté = difficulté;
this.vx = 3;
this.vy = 0;
this.vies = 2; this.vies = 2;
this.amplitude = 20; this.amplitude = 20;
this.direction = 1; this.direction = 1;
...@@ -48,14 +51,6 @@ export default class enemi extends Entite { ...@@ -48,14 +51,6 @@ export default class enemi extends Entite {
return this.vy; return this.vy;
} }
setVx(vx) {
this.vx = vx;
}
setVy(vy) {
this.vy = vy;
}
deplacer() { deplacer() {
this.x -= this.vx; this.x -= this.vx;
this.hitbox.x = this.x; this.hitbox.x = this.x;
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment