What it does
Each course plays on a physics-2d world of its own, with a rope from rope-swing. You hold a move and a reel
direction from step to step, jump when on the ground, fire the rope at a point and release it. The runner walks and
jumps on the ground; in the air or on the rope, the move pushes, which pumps a swing. Reeling shortens or pays out the
rope, and letting go flies the runner on with the speed of the swing.
A course is a set of boxes, hookable or not, a start, a goal, gates in order that act as checkpoints, a fall line below which a pit sends the runner back, and hazards that do the same on touch. The game tracks time, falls, gates passed and shots fired, and a finish earns stars against a par time: three within par, two within half as long again, one otherwise.
view() gives you everything to draw: the runner's position, velocity, size and facing, the rope's line from its hook,
whether it is taut, the surfaces, the gates and the goal. drain() gives events for gates, falls, jumps, the win and
every rope event, such as hooking, wrapping round a corner and mantling over a ledge.
Features
- Swing, reel and fly — fire a rope at any point, swing and pump, reel in and pay out, let go and catch the next rope in mid-air.
- Two ropes and everything between — the ninja rope that wraps round corners, the grapple arm that climbs over
ledges, or any
rope-swingoptions. - Courses as data — boxes in any layout, hookable or not, hazards, gates, a goal, a fall line and gravity.
- Checkpoints — gates passed in order, and falls and hazards that return the runner to the last one.
- Stars and par times — a rating for every finish, with time and falls reported.
- Five ready courses — three for the ninja rope and two for the grapple arm, each proved by a recorded run.
- Saves and validation — snapshots that replay through the kernel's history, and every problem in a course listed before it plays.
Good for
- Rope-swinging platformers, where the rope is the only way across.
- Grappling-hook games with a rope that wraps round corners, in the style of the ninja rope in Worms.
- Climbing games where a grapple arm reels up and mantles over ledges.
- Time-trial courses with par times, stars and checkpoints.
- Touch and mouse games, where pointing is where the rope goes.
Make it yours
A course sets its surfaces, start, goal and its radius, gates, fall line and gravity, the rope as a preset or as your
own rope-swing options for range, reel speed, wrapping, paying out and mantling, the runner's width, height, walk
speed, jump and push, and a par time. There are no pack options; everything is per course.
Two very different courses: a ninja-rope run across a wide pit under a row of short ceilings, where the player swings from one to the next without touching the ground; or a grapple-arm climb up a tall shaft of ledges, reeling in and mantling over each, with hazards on the walls and a strict par.
A quick look
A built-in course, with held movement, a jump, a rope fired at the pointer and released, stepped each frame:
const run = game.ninjaRope.create(game.ninjaRope.courses.ninja[0]!);
game.step('course', dt => {
run.hold({ move: (keys.right ? 1 : 0) - (keys.left ? 1 : 0), reel: (keys.up ? 1 : 0) - (keys.down ? 1 : 0) });
if (keys.jumpPressed) run.jump();
if (pointer.pressed) run.fire(pointerInWorld);
if (keys.releasePressed) run.release();
run.step(dt);
});
Works with
rope-swing— the rope itself; compose it directly for a rope in a game of other rules.physics-2d— the world each course plays on.
Good to know
- Surfaces are boxes that do not turn; the rope wraps round their corners.
- The runner is a box that does not turn. On the ground walking eases to speed; in the air or on the rope the push only adds speed, up to 900.
- It draws nothing: your game presents the view and the events.






