

If the marble is on a gradient on the heightmap, it will increase speed in the direction of the gradient. The player can move the marble left and right with the arrow keys – on a level surface it will gradually slow down if no keys are pressed.
#Marble madness music code#
We’ve left a debug mode in the code by changing the debug variable to True, you can see how the marble moves over the terrain from the overhead viewpoint of the heightmap. The ball rolling physics are calculated from the grey-shaded heightmap graphic. The heightmap can be derived from an overhead view of the terrain, but you’ll probably want to draw the heights of the blocks in a drawing package such as GIMP to give you precise colour values on the map. The angle of the camera is also important, in that we need an X rotation of 54.7 degrees and a Y rotation of 45 degrees to get the lines of the terrain correct. The camera needs to be set to Orthographic to get the forced perspective look we’re after.

We can produce the background graphic using a 3D modelling program such as Blender. Making our gameįor our version of Marble Madness, we’re going to use a combination of a rendered background and a heightmap in Pygame Zero, and write some simple physics code to simulate the marble rolling over the terrain’s flats and slopes. In our sample level, you can control the movement of the marble using the left and right arrow keys. Marble Madness’s popularity endured in the home market, though, with ports made for most computers and consoles of the time – although inevitably, most of these didn’t support the original’s trackball controls. The game was popular in arcades to start with, but interest appeared to drop off after a few months – something Cerny attributed to the fact that the game didn’t take long to play. Marble Madness was the first game to use Atari’s System 1 upgradeable hardware platform, and also boasted the first use of an FM sound chip produced by Yamaha to create its distinctive stereo music. The groundbreaking 3D display was one idea that made it through to the finished game: its pre-rendered, ray-traced isometric levels. This meant that a player could change the angle and speed of the marble as it rolled and avoid various obstacles and baddies.ĭuring development, designer Mark Cerny had to shelve numerous ideas for Marble Madness, since the hardware just wasn’t able to achieve the level of detail and interaction he wanted. The original arcade cabinet provided players with a trackball controller rather than a conventional joystick, and the aim was to guide a marble through a three-dimensional course in the fastest possible time. Hitting arcades in 1984, Atari’s Marble Madness presented a rather different control mechanism than other games of the time. Each of Marble Madness’ six levels got progressively harder to navigate and had to be completed within a time limit.
