Games and partyTilt Marble Maze

Tilt maze physics: how phone tilt controls work and why the marble rolls the way it does

How a tilt maze works on a phone: how the motion sensor reads gravity, why a steeper tilt speeds the marble up, and tips for steering past the holes.

3 min readBy Zarkon

On this page
  1. How does a phone know which way it is tilted?
  2. Why does a steeper tilt make the marble go faster?
  3. What does that mean for playing a tilt maze?
  4. Why does the marble sometimes drift on a flat table?
  5. Questions people ask
  6. Where Tilt Marble Maze helps, and where it does not
  7. Sources

How does a phone know which way it is tilted?

Phones measure tilt with motion sensors. Android’s developer documentation explains that the accelerometer always feels the pull of gravity. When a phone is lying still on a table, its accelerometer reads about 9.81 m/s², the strength of gravity, even though the phone is not moving. In free fall, it reads close to zero.

Android also offers a gravity sensor, which gives a three-dimensional value for the direction and strength of gravity. The documentation says it is typically used to work out the device’s relative orientation in space, and that when the phone is at rest its output should match the accelerometer’s.

The useful part for a maze game is that gravity is shared between the phone’s three axes. Lying flat, nearly all of it is on the axis through the screen. Tip the phone towards you and some of it moves onto the axis running along the phone. A game can read that shift and roll the marble in the same direction.

Why does a steeper tilt make the marble go faster?

OpenStax’s University Physics textbook, published by Rice University, works through an object rolling down a slope without slipping. It shows that the object’s acceleration is proportional to the sine of the slope angle: the steeper the slope, the faster it speeds up. A gentle tilt gives a gentle roll, and a sharp tilt sends the marble racing.

The same chapter shows that a rolling object’s energy is split between moving forward and spinning, and its formula for rolling acceleration also depends on how the object’s mass is spread out.

What does that mean for playing a tilt maze?

  • Small tilts, small corrections. Since acceleration grows with the angle, a slight tilt is easier to control than a big one.
  • Level out to slow down. To stop the marble, bring the board back towards flat, or tip it slightly the other way.
  • Let walls do the work. Rolling the marble gently along a wall keeps it on a straight line past a hole.
  • Start level. If the marble drifts when the phone looks flat, your table or hand may not be level. Find a flatter spot, or hold the phone so the marble sits still, before you start.

Why does the marble sometimes drift on a flat table?

A table that looks flat may not be exactly level, and a phone case can lift one side. The accelerometer reads any slope as a share of gravity on a sideways axis, so the game sees a tilt that you cannot. That is why it helps to check how level your surface is before you play.

Questions people ask

How does a marble maze game on a phone work?

The phone’s motion sensors measure gravity along three axes. When you tilt it, gravity shifts between the axes, and the game rolls the marble that way.

Why does my marble roll on its own?

Your surface may not be perfectly level. Try a flatter surface, or hold the phone so the marble sits still.

Why is it harder to control on a big tilt?

OpenStax explains that a rolling object’s acceleration grows with the angle of the slope, so a big tilt makes the marble speed up much faster.

Where Tilt Marble Maze helps, and where it does not

Tilt Marble Maze is our Android marble maze game, and it works like the classic wooden ball labyrinth toy. Tilt gently to guide a steel ball round the walls of a wooden board to the goal cup, without dropping it into the holes or rolling it off the edge. It uses your phone’s motion sensor for the tilt controls, and each board starts level from however you hold your phone. It plays offline with no account, and your progress stays on your phone.

Free: Oak Workshop, Walnut Study and the daily board. A one-time Full Game unlock adds 40 more boards in four worlds, plus five ball finishes.

What it is good for: a calm tilt game for short puzzle sessions at a desk or on the sofa.

What it will not do: how it feels depends on your phone’s sensors. If the ball drifts, tap Calibrate to reset level to how you are holding the phone.

Questions or bugs: Email us.

Sources

  1. Motion sensorsAndroid Developers developer.android.com
  2. University Physics Volume 1, 11.1 Rolling motionOpenStax openstax.org