mustachio-game 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/.github/workflows/pr.yaml +0 -21
- package/.github/workflows/push.yaml +0 -26
- package/eslint.config.ts +0 -17
- package/index.html +0 -22
- package/src/assets/Mustachio.webp +0 -0
- package/src/assets/Mustachio_FacingLeft.webp +0 -0
- package/src/assets/Mustachio_FacingLeft_Fire.webp +0 -0
- package/src/assets/Mustachio_FacingRight.webp +0 -0
- package/src/assets/Mustachio_FacingRight_Fire.webp +0 -0
- package/src/assets/Mustachio_Fire.webp +0 -0
- package/src/assets/brick.webp +0 -0
- package/src/assets/cannonDown.webp +0 -0
- package/src/assets/cannonLeft.webp +0 -0
- package/src/assets/cannonRight.webp +0 -0
- package/src/assets/cannonUp.webp +0 -0
- package/src/assets/fallingFloor.webp +0 -0
- package/src/assets/homestead.webp +0 -0
- package/src/assets/homesteadClosed.webp +0 -0
- package/src/assets/itemBlock.webp +0 -0
- package/src/assets/obstacleBrick.webp +0 -0
- package/src/assets/punchedBlock.webp +0 -0
- package/src/assets/stacheSeed1.webp +0 -0
- package/src/assets/stacheSeed2.webp +0 -0
- package/src/assets/stacheSeedReversed1.webp +0 -0
- package/src/assets/stacheSeedReversed2.webp +0 -0
- package/src/assets/stacheShotDown.webp +0 -0
- package/src/assets/stacheShotLeft.webp +0 -0
- package/src/assets/stacheShotRight.webp +0 -0
- package/src/assets/stacheShotUp.webp +0 -0
- package/src/assets/stacheSlinger1.webp +0 -0
- package/src/assets/stacheSlinger2.webp +0 -0
- package/src/assets/stacheStalker.webp +0 -0
- package/src/assets/stacheStalkerReversed.webp +0 -0
- package/src/assets/stacheStreaker1.webp +0 -0
- package/src/assets/stacheStreaker2.webp +0 -0
- package/src/classes/game-objects/bg-objects/background.ts +0 -18
- package/src/classes/game-objects/bg-objects/cloud.ts +0 -37
- package/src/classes/game-objects/mustachio.ts +0 -482
- package/src/classes/game-objects/point-objects/enemies/enemy.ts +0 -64
- package/src/classes/game-objects/point-objects/enemies/stache-seed.ts +0 -124
- package/src/classes/game-objects/point-objects/enemies/stache-shot.ts +0 -68
- package/src/classes/game-objects/point-objects/enemies/stache-slinger.ts +0 -63
- package/src/classes/game-objects/point-objects/enemies/stache-stalker.ts +0 -41
- package/src/classes/game-objects/point-objects/enemies/stache-streaker.ts +0 -78
- package/src/classes/game-objects/point-objects/items/coin.ts +0 -72
- package/src/classes/game-objects/point-objects/items/fire-stache.ts +0 -48
- package/src/classes/game-objects/point-objects/items/item.ts +0 -27
- package/src/classes/game-objects/point-objects/items/stacheroom.ts +0 -48
- package/src/classes/game-objects/point-objects/point-item.ts +0 -10
- package/src/classes/game-objects/projectiles/brick-debris.ts +0 -44
- package/src/classes/game-objects/projectiles/enemy-projectiles/enemy-projectile.ts +0 -3
- package/src/classes/game-objects/projectiles/enemy-projectiles/fire-ball.ts +0 -87
- package/src/classes/game-objects/projectiles/enemy-projectiles/fire-bar.ts +0 -65
- package/src/classes/game-objects/projectiles/enemy-projectiles/fire-cross.ts +0 -67
- package/src/classes/game-objects/projectiles/enemy-projectiles/laser.ts +0 -41
- package/src/classes/game-objects/projectiles/projectile.ts +0 -3
- package/src/classes/game-objects/projectiles/stache-ball.ts +0 -57
- package/src/classes/game-objects/set-pieces/flag.ts +0 -34
- package/src/classes/game-objects/set-pieces/obstacles/blocks/block.ts +0 -17
- package/src/classes/game-objects/set-pieces/obstacles/blocks/cave-wall.ts +0 -21
- package/src/classes/game-objects/set-pieces/obstacles/blocks/falling-floor.ts +0 -65
- package/src/classes/game-objects/set-pieces/obstacles/blocks/fire-bar-block.ts +0 -31
- package/src/classes/game-objects/set-pieces/obstacles/blocks/fire-cross-block.ts +0 -28
- package/src/classes/game-objects/set-pieces/obstacles/blocks/punchable-blockS/brick.ts +0 -44
- package/src/classes/game-objects/set-pieces/obstacles/blocks/punchable-blockS/item-block.ts +0 -82
- package/src/classes/game-objects/set-pieces/obstacles/blocks/punchable-blockS/punchable-block.ts +0 -6
- package/src/classes/game-objects/set-pieces/obstacles/blocks/stache-cannon.ts +0 -54
- package/src/classes/game-objects/set-pieces/obstacles/blocks/wall.ts +0 -22
- package/src/classes/game-objects/set-pieces/obstacles/floor.ts +0 -27
- package/src/classes/game-objects/set-pieces/obstacles/obstacle-types.ts +0 -14
- package/src/classes/game-objects/set-pieces/obstacles/obstacle.ts +0 -3
- package/src/classes/game-objects/set-pieces/obstacles/pipe.ts +0 -35
- package/src/classes/game-objects/set-pieces/obstacles/warp-pipe.ts +0 -17
- package/src/classes/game-objects/set-pieces/set-piece.ts +0 -3
- package/src/classes/game-objects/ui-objects/score-display.ts +0 -10
- package/src/classes/game-objects/ui-objects/timer-display.ts +0 -15
- package/src/classes/game-objects/ui-objects/ui-object.ts +0 -16
- package/src/classes/game-objects/ui-objects/win-display.ts +0 -25
- package/src/dev.ts +0 -5
- package/src/index.ts +0 -3
- package/src/levels/caves/cave-one.ts +0 -90
- package/src/levels/level-helpers.ts +0 -101
- package/src/levels/level-one.ts +0 -379
- package/src/levels/test-levels/blocks-and-items.ts +0 -77
- package/src/levels/test-levels/cannon-and-cross.ts +0 -75
- package/src/levels/test-levels/caves-and-enemies.ts +0 -73
- package/src/levels/test-levels/win-game.ts +0 -24
- package/src/main.ts +0 -6
- package/src/mustachi-game-context.ts +0 -35
- package/src/shared/app-code.ts +0 -106
- package/src/shared/constants.ts +0 -1
- package/src/shared/game-context.ts +0 -547
- package/src/shared/game-objects/game-object.ts +0 -28
- package/src/shared/game-objects/moving-game-object.ts +0 -46
- package/src/shared/game-objects/rotating-game-object.ts +0 -58
- package/src/shared/game-objects/updating-game-object.ts +0 -7
- package/src/shared/player.ts +0 -73
- package/src/shared/types.ts +0 -21
- package/tsconfig.json +0 -26
- package/vite.config.ts +0 -13
package/src/shared/player.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { GameContext } from "./game-context";
|
|
2
|
-
import { GameObject } from "./game-objects/game-object";
|
|
3
|
-
import { MovingGameObject } from "./game-objects/moving-game-object";
|
|
4
|
-
import { direction, type rectangle } from "./types";
|
|
5
|
-
|
|
6
|
-
export abstract class Player extends MovingGameObject {
|
|
7
|
-
protected ignoreUpdate = false;
|
|
8
|
-
isDead: boolean = false;
|
|
9
|
-
blockedDirHor: number = direction.NONE;
|
|
10
|
-
blockedDirVert: number = direction.NONE;
|
|
11
|
-
speedX: number = 0;
|
|
12
|
-
speedY: number = 0;
|
|
13
|
-
numJumps = 0;
|
|
14
|
-
|
|
15
|
-
protected readonly gameContext: GameContext;
|
|
16
|
-
|
|
17
|
-
constructor(gameContext: GameContext, rect: rectangle) {
|
|
18
|
-
super(gameContext, rect);
|
|
19
|
-
|
|
20
|
-
this.gameContext = gameContext;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected handleGravity() {
|
|
24
|
-
if (this.blockedDirVert !== direction.DOWN) {
|
|
25
|
-
this.speedY += this.gameContext.gravity;
|
|
26
|
-
this.rect.y += this.speedY;
|
|
27
|
-
// if (this.speedY > this.maxSpeedY) {
|
|
28
|
-
// this.speedY = this.maxSpeedY
|
|
29
|
-
// }
|
|
30
|
-
|
|
31
|
-
// Fall off the screen
|
|
32
|
-
if (this.rect.y + this.rect.height >= this.gameContext.gameArea.height) {
|
|
33
|
-
this.playerKill();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
canMove(dir: number) {
|
|
39
|
-
return (
|
|
40
|
-
!this.ignoreUpdate &&
|
|
41
|
-
!this.isDead &&
|
|
42
|
-
(this.blockedDirHor === direction.NONE || this.blockedDirHor !== dir)
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
jump() {
|
|
47
|
-
if (this.numJumps >= 2) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
this.speedY = -14;
|
|
52
|
-
this.numJumps++;
|
|
53
|
-
this.blockedDirVert = direction.NONE;
|
|
54
|
-
this.rect.y -= 5;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
landOnGameObject(gameObject: GameObject) {
|
|
58
|
-
this.blockedDirVert = direction.DOWN;
|
|
59
|
-
this.rect.y = gameObject.rect.y - this.rect.height + 1;
|
|
60
|
-
this.numJumps = 0;
|
|
61
|
-
this.speedY = 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
abstract playerHit(): void;
|
|
65
|
-
|
|
66
|
-
abstract playerKill(): void;
|
|
67
|
-
|
|
68
|
-
abstract customKeyDown(key: string): void;
|
|
69
|
-
|
|
70
|
-
abstract customKeyUp(key: string): void;
|
|
71
|
-
|
|
72
|
-
abstract reset(x?: number, y?: number): void;
|
|
73
|
-
}
|
package/src/shared/types.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { GameObject } from "./game-objects/game-object";
|
|
2
|
-
|
|
3
|
-
export const direction = {
|
|
4
|
-
UP: 1,
|
|
5
|
-
DOWN: 2,
|
|
6
|
-
LEFT: 3,
|
|
7
|
-
RIGHT: 4,
|
|
8
|
-
NONE: 0,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type rectangle = {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type collision = {
|
|
19
|
-
gameObject: GameObject;
|
|
20
|
-
collisionDirection: number;
|
|
21
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"types": ["vite/client"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["src"]
|
|
26
|
-
}
|
package/vite.config.ts
DELETED