Jump pad
A same-floor travel recipe moves the entering player four cells east when a safe landing exists.
What it demonstrates: Offset travel · validated movement.
Run this example
All learning examples are available in your developer world on scape.wtf. To edit this example, clone the public Scape tools repository and run its project with Node.js 22+:
sh
git clone https://github.com/scape-wtf/scape-tools.git
cd scape-tools
npm install
cd examples/gizmos/jump-pad
npm run build
npm test
npm exec -- scape gizmo dev1
2
3
4
5
6
7
2
3
4
5
6
7
This connects to https://scape.wtf. Follow connection and approval. To make an independent project, copy this example directory outside the checkout, then run npm install, npm run build, npm test and npm exec -- scape gizmo dev there. Its manifest uses published SDK and CLI dependencies. The project's npm run dev script is a shortcut for scape gizmo dev.
Try changing it
Try a different bounded offset and exit order. Validate blocked, occupied, and out-of-bounds landings in your developer world.
Source
This code is included directly from the working example when the site builds.
src/definition.ts
ts
/** Jump pad demonstrates a directional offset destination with authored character motion and chained landings. */
import { defineObject, exactKeys, record } from '@scape-wtf/sdk';
export const jumpPad = defineObject<Record<string, never>>({
type: 'examples.jump-pad',
version: 1,
emoji: '⏩',
label: 'Jump pad',
hint: 'Step onto this pad to jump four cells east',
initial: () => ({}),
valid: (state): state is Record<string, never> => record(state) && exactKeys(state, []),
actions: {},
walkable: true,
travel: () => ({
destination: { kind: 'offset', x: 4, y: 0 },
exits: [[0, 0]],
cooldownMs: 650,
activateOnArrival: true,
motion: {
durationMs: 700,
// Lift is in cells. Neutral endpoints avoid a snap between consecutive pads.
frames: [
{ at: 0, offset: [0, 0], scale: [1, 1], rotation: 0 },
{ at: 0.12, offset: [0, 0.15], scale: [0.9, 1.12], rotation: -0.06 },
{ at: 0.5, offset: [0, 1.6], scale: [1, 1], rotation: 0 },
{ at: 0.86, offset: [0, 0.2], scale: [0.94, 1.08], rotation: 0.04 },
{ at: 0.94, offset: [0, 0], scale: [1.12, 0.88], rotation: 0 },
{ at: 1, offset: [0, 0], scale: [1, 1], rotation: 0 },
],
},
}),
});
export default jumpPad;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
src/project.ts
ts
/** Standalone project entry for the Scape development CLI. */
import { defineProject } from '@scape-wtf/sdk';
import { jumpPad } from './definition.js';
export default defineProject({
name: 'Jump pad',
description: 'Arc four cells east and chain jumps by landing on another pad.',
objects: [jumpPad],
});1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
