22.12.2016 Views

CODING

MagPi53

MagPi53

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Tutorial<br />

WALKTHROUGH<br />

>STEP-02<br />

Make the box bottoms<br />

A band clamp was used to ensure the sides were<br />

perpendicular to the base as they were glued together.<br />

We used Gorilla glue and moistened the wood before<br />

applying the glue. After about two hours, the clamp<br />

was removed and excess glue cut off with a scalpel.<br />

Drill the base with an M3 drill for both the corner hex<br />

pillars and the nuts and bolts for the ball rests.<br />

The resources<br />

The graphics for the horses were taken from a cutout<br />

supplement, printed in the Boston Sunday Globe<br />

in September 1905, by RF Ayers; this is now well out<br />

of copyright. This cut-out featured two horses in<br />

mid-gallop, curiously carrying the numbers ‘one’<br />

and ‘three’ on the saddle cloth. We have named the<br />

first horse ‘Raspberry Rake’ and the third ‘Not Quite<br />

Pi’, which we thought were suitable racing names.<br />

These horses were cut out electronically in a graphics<br />

package, and the background made transparent.<br />

Then they were reduced to just 196 by 136 pixels. The<br />

graphic of a track was drawn with a finishing post and<br />

line, and then a front rail was drawn with transparent<br />

sections between the rails. Finally, a sequence of<br />

graphics was drawn to indicate the required path of<br />

the ball bearing for each challenge. We also gathered<br />

a series of sound effects from the internet to help the<br />

game along.<br />

Playing the game<br />

The graphic by the horse name shows the two points<br />

the ball bearing must visit to advance the horse. The<br />

filled orange circle indicates the current target for<br />

your ball: only when you visit the start position, and<br />

then the end one, will the horse move. When you<br />

have just visited the start position, there will be a<br />

horse whinnying sound, and then you get the horse<br />

galloping sound and animation when you visit the<br />

last position. When the horse advances, not only<br />

does it go forward, but it also moves slightly up and<br />

down in a galloping motion; this mimics the original<br />

fairground version. When one of the horses crosses<br />

52 January 2017<br />

raspberrypi.org/magpi

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!