Ragdoll Mayhem Maker - Game and Level Editor Tutorial
Welcome to the official guide for Ragdoll Mayhem Maker! This tutorial covers how to play the game and provides an in-depth look at creating your own levels using the powerful built-in Level Editor.
Player Guide
The objective of the game is to launch a ragdoll through a level, interacting with various physics objects to either reach a goal or accumulate points by colliding with objects.
Controls
- Up/Down Arrows: Increase or decrease the launch strength. The strength bar is shown in the top-left corner.
- Left/Right Arrows: Change the angle of the launch arrow.
- Z: Launch the ragdoll! This can only be done once at the start of the level.
- Escape: Open the in-game menu to reset the level or exit.
Game Elements
You will encounter many different objects in the game world:
- Goal: A green box. The level is won if the ragdoll stops completely inside it.
- Fans: These will blow your ragdoll in the direction they are pointing.
- Cogs & Saws: Moving hazards. Contact with them will add points, but they can also block your path.
- Bumpers: Circular, rectangular, or triangular objects that provide a strong bounce, adding points on impact.
- Bombs: Explode on contact, sending your ragdoll flying.
- Gravity Indicators: Touching these will reverse the world's gravity.
- Flippers: These are activated automatically on contact, sending your ragdoll flying, pinball-style!
- Trampolines: A bouncy platform that propels the ragdoll upwards.
- Escalators: A moving conveyor belt made of small spinning circles.
Level Editor Guide
This is where the real creativity happens. The level editor gives you direct access to the level's structure via a JSON (JavaScript Object Notation) file. You can create, modify, and place any object in the game.
The Editor Interface
When you open the editor, the screen is split into two parts:
- The Level View (Left Side): A visual representation of your level. You can see the placement of all your objects here.
- The JSON Editor (Right Side): A text editor where you define every element of your level in JSON format. This is where you'll do all your work.
At the bottom right, below the JSON editor, you will find "Save" and "Test" buttons.
- Save (Ctrl+S): Parses the JSON text and refreshes the Level View. If your JSON has errors, a message will appear.
- Test (Ctrl+T): Saves the level and immediately loads it in play mode for you to test. While testing, you can press 'B' to return to the editor.
The Anatomy of a Level File (JSON)
Every level is a single JSON file. The structure consists of an array [ ]
containing a single
object { }
. Inside this object, you define key-value pairs for all the level's properties and
objects.
[ { "filename": "my-level.json", "points": 500, "ragdoll": [ { "x": 100, "y": 100 } ], "walls": [ { "width": 2000, "height": 1800 } ], "goal": [ { "x": 1800, "y": 1600, "width": 200, "height": 200 } ] ... (other objects like blocks, saws, fans go here) ... } ]
Core Level Properties
These are the fundamental properties for any level.
Property | Description |
---|---|
"filename" |
Required. The name of the file your level will be saved as (e.g.,
"my-first-level.json" ). |
"ragdoll" |
Required. An array containing one object that sets the starting x and y coordinates of the player. |
"walls" |
Required. An array containing one object that sets the playable area's width and height. This defines the outer boundaries. |
"points" |
Optional. The target score needed to pass the level. If a "goal" object is
not present, reaching this score is the win condition. |
Level Objects Reference
Here is a complete list of all objects you can add to your level. Each object type is a key whose value is an array of objects. You can add multiple objects of the same type.
Static & Interactive Objects
Object Type | Properties | Description |
---|---|---|
block |
x, y, width, height , angle, isBumper (true/false), friction (number) |
A basic rectangular block. Set isBumper to true for high bounce. |
triangles |
x, y, a, b, c, angle , bodyType ("static"/"dynamic"), isBumper
(true/false) |
A triangular block defined by its three side lengths (a, b, c). |
circles |
x, y, radius , bodyType ("static"/"dynamic"), isBumper (true/false) |
A circular object. Can be a bumper. |
stairs |
rectLeft, rectTop, rectWidth, rectHeight, rectExtend, horizontalExtend, amount ,
fromRight (true/false) |
Creates a series of steps. fromRight builds the stairs from the right edge.
|
spikes |
x, y |
A static spike hazard. Mostly for decoration and point scoring. |
solidSlope |
x, y |
A pre-defined, complex static slope object. |
trampolines |
x, y |
A bouncy platform that propels the ragdoll. |
toilets |
x, y , flip (true/false) |
A toilet-shaped object. flip mirrors it horizontally. |
arcs |
x, y, width, degrees, angle |
Creates a curved wall segment. `width` is the diameter, `degrees` is the length of the arc (e.g., 180 for a semi-circle), and `angle` is the starting rotation. |
Moving & Dynamic Objects
Object Type | Properties | Description |
---|---|---|
fans |
x, y, power, direction ("clockwise"/"anticlockwise"), initialAngle |
A spinning fan blade that pushes the ragdoll. `power` maps to motor speed. |
cogs |
x, y, motorSpeed , direction ("clockwise"/"anticlockwise") |
A large, spinning cog with arms. |
saws |
x, y, motorSpeed , direction ("clockwise"/"anticlockwise") |
A spinning saw blade. |
bombs |
x, y |
Explodes on contact, applying a large force. |
flippers |
x, y, angle, side ("left"/"right") |
Pinball flippers. Activated automatically on contact. |
escalators |
x, y, numSaws, motorSpeed, direction, angle |
Creates a conveyor belt made of many small spinning circles. `numSaws` is the number of circles. |
Grouped & Special Objects
Object Type | Properties | Description |
---|---|---|
pyramids |
x, y, blockSize, height , shape ("circle" or "square"), smell |
Creates a pyramid of dynamic blocks that can be knocked over. The `smell` property is a creative name for an object identifier used for special behaviors (e.g., coloring). |
blockGroup |
x, y, blockSize, width, height |
Creates a grid of dynamic blocks. |
gravity |
x, y |
Creates a gravity indicator. When the ragdoll touches it, gravity reverses. |
Coordinates System: The origin (0,0) is at the top-left corner of the level. The X value increases to the right, and the Y value increases downwards.
Using External JSON Editors
While the in-game editor is functional, it's very basic. For a much better experience, we strongly recommend using an external code editor.
Why Use an External Editor?
- Syntax Highlighting: Makes the JSON structure much easier to read.
- Error Checking: Immediately shows you if you've missed a comma or a bracket.
- Auto-Formatting: Can automatically clean up the indentation and layout of your file.
- Find and Replace: Easily change multiple values at once.
Recommended Editors
Any modern text editor will work. Here are some excellent free options:
- Visual Studio Code
- Sublime Text
- Notepad++ (Windows only)
Workflow with an External Editor
- Create a new level file in the game's root directory (e.g.,
my-cool-level.json
). You can copy the contents ofeditor.json
as a starting template. - Open this file in your external editor (like VS Code).
- Make your changes and save the file.
- In the game, go to the Main Menu and choose "(E)ditor Levels".
- Select your new level from the list. It will now open in the in-game level editor.
- From here, you can use the "Test" button to play it, or continue to make small tweaks in the in-game editor.
Important: The game only loads the level file when you open it in the editor. If you make changes in your external editor while the level is already open in-game, you will need to go back to the level selection screen and re-open it to see your changes.