@waica/archetype-platformer 0.20.0 → 0.22.0
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/dist/controls.d.ts +1 -1
- package/dist/controls.js +4 -4
- package/dist/prefabs.js +27 -0
- package/dist/registry-data.js +2 -1
- package/package.json +3 -3
package/dist/controls.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputBindings } from '@waica/engine';
|
|
2
|
-
/** Platformer actions
|
|
2
|
+
/** Platformer actions: the exact legacy keyboard defaults plus the left stick, D-pad and A (ADR 0023). */
|
|
3
3
|
export declare const PLATFORMER_BINDINGS: Readonly<InputBindings>;
|
|
4
4
|
/** Friendly labels shown by the editor's controls panel. */
|
|
5
5
|
export declare const PLATFORMER_ACTION_LABELS: Readonly<Record<string, string>>;
|
package/dist/controls.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** Platformer actions
|
|
1
|
+
/** Platformer actions: the exact legacy keyboard defaults plus the left stick, D-pad and A (ADR 0023). */
|
|
2
2
|
export const PLATFORMER_BINDINGS = {
|
|
3
|
-
left: ['ArrowLeft', 'KeyA'],
|
|
4
|
-
right: ['ArrowRight', 'KeyD'],
|
|
5
|
-
jump: ['Space', 'ArrowUp', 'KeyW'],
|
|
3
|
+
left: ['ArrowLeft', 'KeyA', 'Gamepad:LeftStickLeft', 'Gamepad:DPadLeft'],
|
|
4
|
+
right: ['ArrowRight', 'KeyD', 'Gamepad:LeftStickRight', 'Gamepad:DPadRight'],
|
|
5
|
+
jump: ['Space', 'ArrowUp', 'KeyW', 'Gamepad:A'],
|
|
6
6
|
};
|
|
7
7
|
/** Friendly labels shown by the editor's controls panel. */
|
|
8
8
|
export const PLATFORMER_ACTION_LABELS = {
|
package/dist/prefabs.js
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { PLAYER_STATE_GRAPH } from '@waica/behaviors';
|
|
2
2
|
import { DOG_SPRITE } from './scene-default.js';
|
|
3
|
+
/** The dog's jump and landing dust: pale, sinking toward the feet, then spreading sideways. */
|
|
4
|
+
const GROUND_DUST = {
|
|
5
|
+
rate: 0,
|
|
6
|
+
lifetime: 0.45,
|
|
7
|
+
positionSpread: [0.35, 0.05],
|
|
8
|
+
velocity: [0, -2.2],
|
|
9
|
+
velocitySpread: [2.8, 0.4],
|
|
10
|
+
gravity: [0, 5],
|
|
11
|
+
space: 'world',
|
|
12
|
+
seed: 9,
|
|
13
|
+
capacity: 48,
|
|
14
|
+
width: 0.18,
|
|
15
|
+
height: 0.18,
|
|
16
|
+
startScale: 1,
|
|
17
|
+
endScale: 2,
|
|
18
|
+
startColor: 0xe6d2b0,
|
|
19
|
+
endColor: 0xa08c70,
|
|
20
|
+
startAlpha: 0.8,
|
|
21
|
+
endAlpha: 0,
|
|
22
|
+
layer: -1,
|
|
23
|
+
};
|
|
3
24
|
/**
|
|
4
25
|
* The archetype's reusable entity templates, keyed by ref ('characters/slime').
|
|
5
26
|
* Scenes reference these and override per-entity props; the palette derives
|
|
@@ -27,6 +48,12 @@ export const PLATFORMER_PREFABS = {
|
|
|
27
48
|
{ type: 'Respawnable' },
|
|
28
49
|
{ type: 'Health', props: { max: 3, invulnerability: 1 } },
|
|
29
50
|
{ type: 'OutOfBounds', props: { minY: -8 } },
|
|
51
|
+
// Dust at the ground: a burst-only emitter DustPuffs fires on a
|
|
52
|
+
// ground takeoff and on every grounded landing. Layer -1 puts it
|
|
53
|
+
// behind the dog and under the ground tiles, so the puff rises from
|
|
54
|
+
// the floor instead of covering the body.
|
|
55
|
+
{ type: 'ParticleEmitter', props: GROUND_DUST },
|
|
56
|
+
{ type: 'DustPuffs', props: { jumpCount: 5, landCount: 12 } },
|
|
30
57
|
],
|
|
31
58
|
},
|
|
32
59
|
'characters/slime': {
|
package/dist/registry-data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimatedSprite, DynamicBody, Hitbox, ParticleEmitter, Solid, Sprite, StateMachine, } from '@waica/engine';
|
|
2
|
-
import { Chaser, Collectible, Hazard, Health, Lifetime, OutOfBounds, Patrol, PlatformerMotor, Respawnable, SceneTransition, } from '@waica/behaviors';
|
|
2
|
+
import { Chaser, Collectible, DustPuffs, Hazard, Health, Lifetime, OutOfBounds, Patrol, PlatformerMotor, Respawnable, SceneTransition, } from '@waica/behaviors';
|
|
3
3
|
import { PLATFORMER_ART } from './art.js';
|
|
4
4
|
import { PLATFORMER_PREFABS } from './prefabs.js';
|
|
5
5
|
import { PLATFORMER_UI } from './ui.js';
|
|
@@ -15,6 +15,7 @@ export const PLATFORMER_REGISTRY_DATA = {
|
|
|
15
15
|
DynamicBody,
|
|
16
16
|
StateMachine,
|
|
17
17
|
PlatformerMotor,
|
|
18
|
+
DustPuffs,
|
|
18
19
|
Collectible,
|
|
19
20
|
Patrol,
|
|
20
21
|
Chaser,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waica/archetype-platformer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Waica platformer archetype — opinionated setup for side-scrolling platformers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@waica/behaviors": "^0.
|
|
28
|
-
"@waica/engine": "^0.
|
|
27
|
+
"@waica/behaviors": "^0.22.0",
|
|
28
|
+
"@waica/engine": "^0.22.0"
|
|
29
29
|
}
|
|
30
30
|
}
|