Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
srikar2429 committed Jun 19, 2024
1 parent afa391b commit 3f70382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ class Zombie {
this.y = this.game.height - this.height;
this.vy = 0;
if (!this.froze) {
if (this.x < this.game.player.x) {
if (this.x + this.width <= this.game.player.x) {
this.x += this.vx;
} else {
} else if(this.x >= this.game.player.x+this.game.player.width){
this.x -= this.vx;
}
}
Expand Down

0 comments on commit 3f70382

Please sign in to comment.