From 5d666d0bf10be1e22073462fe8493248403d8dfc Mon Sep 17 00:00:00 2001 From: Rayane Belguebli <rayane.belguebli.etu@univ-lille.fr> Date: Fri, 5 Apr 2024 11:15:34 +0200 Subject: [PATCH] correct deplacement enemis --- server/enemis.js | 15 +++++---------- {client/src => server}/enemis.test.js | 0 2 files changed, 5 insertions(+), 10 deletions(-) rename {client/src => server}/enemis.test.js (100%) diff --git a/server/enemis.js b/server/enemis.js index 655ef09..0d87d1e 100644 --- a/server/enemis.js +++ b/server/enemis.js @@ -12,11 +12,14 @@ export default class enemi extends Entite { constructor(x, y, image, difficulté) { super(x, y, new Hitbox(50 / 2, 66, x, y), image); if (difficulté == 1) { + this.vx = 3; + this.vy = 0; 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.vx = 3; - this.vy = 0; this.vies = 2; this.amplitude = 20; this.direction = 1; @@ -48,14 +51,6 @@ export default class enemi extends Entite { return this.vy; } - setVx(vx) { - this.vx = vx; - } - - setVy(vy) { - this.vy = vy; - } - deplacer() { this.x -= this.vx; this.hitbox.x = this.x; diff --git a/client/src/enemis.test.js b/server/enemis.test.js similarity index 100% rename from client/src/enemis.test.js rename to server/enemis.test.js -- GitLab