Skip to content

Commit

Permalink
Working on collision direction
Browse files Browse the repository at this point in the history
  • Loading branch information
YamanSD committed May 16, 2024
1 parent c6fbef3 commit c988d59
Show file tree
Hide file tree
Showing 5 changed files with 428 additions and 14 deletions.
Binary file modified assets/images/x_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/x_3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 26 additions & 2 deletions js/Game/Sprites/BusterShot.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class BusterShot extends Sprite {
height: 18
}
]);
} else {
} else if (power < 4) {
this.currentAnimation = this.createAnimation(
0,
310,
Expand All @@ -115,8 +115,32 @@ class BusterShot extends Sprite {
height: 30
}
]);
} else {
this.currentAnimation = this.createAnimation(
1,
503,
7,
4,
1,
4,
71,
58,
1,
0,
3
);

this.hitBox = this.convertHitBoxes([
{
x,
y,
width: 71,
height: 58
}
]);
}

this.y -= this.height / 2;
this.flip = left;
}

Expand All @@ -140,7 +164,7 @@ class BusterShot extends Sprite {
* @returns {string[]} sprite sheets.
*/
static get sheets() {
return ['x_3.gif'];
return ['x_3.gif', 'x_2.png'];
}

/**
Expand Down
Loading

0 comments on commit c988d59

Please sign in to comment.