fix Mouse

This commit is contained in:
adeliptr 2025-05-10 15:31:02 +09:00
parent 2ca032f930
commit ca8adb23c0
12 changed files with 14 additions and 15 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
assets/.DS_Store vendored

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -209,7 +209,6 @@ class DoubleYarnCat extends Cat {
else this.switchToIdle();
if (this.active && (millis() - this.lastShot > 3000)) {
// TODO: check on the offset again
for (let offset of [0, 0.3 * gameFrame.tileWidth]) {
let yarnX = this.x + gameFrame.tileWidth / 2 + offset;
let yarnY = this.y;

View File

@ -19,7 +19,7 @@ class Mouse {
* @param {number} speed - The speed of the mouse's movement
* @param {number} HP - The health points of the mouse
* @param {number} AP - The attack power of the mouse
* @param {object} spriteSheet - The sprite sheet for the mouse animation
* @param {p5.SpriteSheet} spriteSheet - The sprite sheet for the mouse animation
* @param {number} size - The size of the mouse sprite
*/
constructor(row, speed, HP, AP, spriteSheet, size) {
@ -111,8 +111,8 @@ class Mouse {
* Basic type of mouse
*/
class BasicMouse extends Mouse {
constructor(x, y, row) {
super(x, y, row, -0.15, 100, 20, mouseAnimation.basicMouse, gameFrame.tileWidth);
constructor(row) {
super(row, -0.15, 100, 20, mouseAnimation.basicMouse, gameFrame.tileWidth);
}
}
@ -121,8 +121,8 @@ class BasicMouse extends Mouse {
* Has a higher HP compared to BasicMouse
*/
class HelmetMouse extends Mouse {
constructor(x, y, row) {
super(x, y, row, -0.15, 150, 20, mouseAnimation.helmetMouse, gameFrame.tileWidth);
constructor(row) {
super(row, -0.15, 150, 20, mouseAnimation.helmetMouse, gameFrame.tileWidth);
}
}
@ -131,8 +131,8 @@ class HelmetMouse extends Mouse {
* Has a higher speed compared to Basic Mouse
*/
class SportyMouse extends Mouse {
constructor(x, y, row) {
super(x, y, row, -0.3, 85, 20, mouseAnimation.sportyMouse, gameFrame.tileWidth);
constructor(row) {
super(row, -0.3, 85, 20, mouseAnimation.sportyMouse, gameFrame.tileWidth);
}
}
@ -142,8 +142,8 @@ class SportyMouse extends Mouse {
* Has a slower speed compared to the other types
*/
class BossMouse extends Mouse {
constructor(x, y, row) {
super(x, y, row, -0.05, 1000, 50, mouseAnimation.bossMouse, 3 * gameFrame.tileWidth);
constructor(row) {
super(row, -0.05, 1000, 50, mouseAnimation.bossMouse, 3 * gameFrame.tileWidth);
}
}

View File

@ -36,11 +36,11 @@ function preload() {
catImages.sleepyCat = loadImage('assets/sleepy_cat_icon.png');
catImages.iceCat = loadImage('assets/ice_cat_icon.png');
catAnimation.chefCat = loadImage('assets/chef_cat_ani.png');
catAnimation.singleYarnCat = loadImage('assets/single_yarn_cat_ani.png');
catAnimation.doubleYarnCat = loadImage('assets/double_yarn_cat_ani.png');
catAnimation.sleepyCat = loadImage('assets/sleepy_cat_ani.png');
catAnimation.iceCat = loadImage('assets/ice_cat_ani.png');
catAnimation.chefCat = loadImage('assets/cat/chef_cat_ani.png');
catAnimation.singleYarnCat = loadImage('assets/cat/single_yarn_cat_ani.png');
catAnimation.doubleYarnCat = loadImage('assets/cat/double_yarn_cat_ani.png');
catAnimation.sleepyCat = loadImage('assets/cat/sleepy_cat_ani.png');
catAnimation.iceCat = loadImage('assets/cat/ice_cat_ani.png');
mouseAnimation.basicMouse = loadImage('assets/mouse/basic_mouse_ani.png');
mouseAnimation.helmetMouse = loadImage('assets/mouse/helmet_mouse_ani.png');