How Draw Climber Turns One Stroke Into Two Legs
Published · Updated · 3 min read
The home page explains the basics: draw in the box, the line becomes legs, redraw when the ground changes. This post goes one level down. We read the game script of the HTML5 build on this site to see exactly what happens to a line after you draw it. Knowing this makes it much easier to draw legs that do what you want on the first try.
Your starting point is the hinge
When your finger or mouse first touches the drawing box, the game records that point. Every other point of the line is measured from it. When you let go, the start of the line is placed on the centre of the cube, and the legs turn around that spot.
So the place where you start drawing matters more than the place where you stop. A line that starts at one end and goes outward makes a leg that sticks out from the middle of the cube. A line that starts somewhere strange, such as the tip of a hook, puts the hinge at the tip and gives you a lopsided spinner.
The game adds a mirrored copy
The game does not build one leg. It builds two identical copies of your line, welds them together at the cube's centre, and turns the second copy half a turn (180 degrees). That is why a single straight stroke gives you a straight bar through the cube, like a two-spoke wheel, and an L-shape gives you two hooks pointing in opposite directions.
Keep this in mind when you draw curves. You only need to draw one side. The other side is added for you, facing the other way.
The legs are smaller than your drawing
The line on the course is drawn at about 30% of the size of your stroke in the box. The game also breaks your stroke into short pieces: a new piece is only added each time your pointer moves a set distance from the last one. Very small wiggles get lost, so draw shapes with clear, simple parts instead of fine detail.
Only the part inside the box counts
- Points are only recorded while your pointer is inside the dashed box. If you drag outside it, that part of the line is ignored.
- If you release the mouse or lift your finger outside the box, the whole stroke is thrown away and your old legs stay on.
- Releasing inside the box replaces the old legs at once, so you can redraw as often as you like.
The cube waits for you
At the start of a level the cube is fixed in place. It only starts to fall and move after your first stroke. You can take your time to look at the first part of the course before drawing.
Why the legs do all the work
The game uses the Box2D physics engine. In the code, the cube's body is actually a circle, and it has very little grip. The leg pieces are given much higher grip than the cube, and they are driven by a motor at the hinge. That is why the cube slides if its legs cannot reach the ground, and why the right leg length matters so much.
The motor also speeds up. Each level starts with the legs turning at a set pace, which then rises until it is about half again as fast and stays there. Gravity rises at the same time, so the cube feels heavier as it goes faster. Expect the second half of a long flat run to be quicker than the first.
Skins do not change the physics
Every skin in the shop sits on the same round body with the same legs. A skin changes how the cube looks, not how it climbs, so pick the one you like.
Putting it together
- Start each stroke where you want the hinge, usually at one end of the line.
- Draw one side only, and picture the mirrored copy.
- Draw bigger than you think, because the legs are scaled down.
- Always finish the stroke inside the box.
More from the blog
- Inside the Browser Draw Climber: 60 Levels, Coins and Skins
This Draw Climber build has 60 built levels that then repeat, nine skins with rising unlock prices, and saves in your browser. Here is what the files show.
- Draw Climber Obstacles: Spikes, Crates, Balls and Bolts
Which Draw Climber objects can end your run, which ones move, and what the speed bolt really does. Based on the game's own level code.