Code Club’s Desert Race Game – with physical controls

Playing Desert Race with a Makey Makey



Tin Foil
A banana
A courgette
Wire (about 4 metres)
Makey Makey
Desert Race game
Tape (gaffer or something quite strong)

Simple Diagram

Simple wiring diagram for Desert Race.
Simple wiring diagram for Desert Race.

Setting up the game

  1. This is a pretty easy conversion – all you need to do is change the keypress on the lion to “when W key pressed” to allow for the limited key inputs on the makey makey:

    What to change the lion script to in scratch.
    The updated script on the lion sprite.
  2. If you have completed the bonus challenge to add boosts to the game, you could extend this and make another input using the makey makey, something else conductive (like more fruit) and a piece of wire!

Setting up the controllers

  1. To make the foot pads, cut some cardboard in tin foil, big enough for 2 little feet to fit on (or big feet if you’re making it for big kids!).
  2. Using some tape, secure a length of wire, stripped of insulation at both ends, to the cardboad, the wire needs to be around 1 metre in length, to allow it to reach the makey makey and the foot pad on the floor.
  3. Cover the cardboard with some glue (I used spray mount) and cover the whole of one side of the cardboard (but not the bare wire) glue. Cover the cardboard with tin foil. Making sure that the wire you secured to the cardboard is touching the tin foil (and not covered in glue!).
  4. Attach the wires from one of the foot pads to the W key on the makey makey (the lion pad) and the other to the A key on the makey makey for the parrot, remember which pad is connnected to which key (I marked my pads with a lion and parrot image to make it easier).
  5. Next take your items of fruit of vegetable (it’s fruit just for novelty value) and insert some wire (again about a metre and stripped at both ends) directly into the flesh of the fruit. Sercure the wire with some tape so it won’t fall out the fruit too easily.
  6. Attach the wires from both pieces of fruit to ground on the makey makey.
  7. Plug in the makey makey to your computer running the scratch game Desert Race (with the updated key press as above).
  8. Now just press start and with shoes and socks off, hold the fruit in your hand and run/jump up and down on the foot pad to make your character go! The faster you run or jump, the faster the character will move!
  9. And finally, don’t forget to explain how the Makey Makey uses electrical current and creating a circuit to make the characters move!




JavaScript Code Club Part II

So after a chat with some of my initial advisory committee (Jack Franklin, Micheil Smith, David Smith, Susanne Feldhusen and Arran Ross Paterson) I have refined what I think I’m looking at/for.

I think the initial requirement is for a kind of drop-in center for people to mingle with JavaScript mentors who can help them with specific problems they are having or help the solve specific problems.

To keep people interested and to make sure there is something to discuss, I would get a few mentors to set up a number of tasks (similar to assignments on that people can set about and request advice or help if they can’t complete any parts of the work.

The ‘syllabus’ as it were would feature real life problems – including completing tasks without jQuery, creating sliders, using animation, building with things like backbone, API use etc  all the time promoting best practice.  By setting a number of tasks that people can choose from, but that mentors would be able to complete in a straightforward manner would hopefully mean that people will have an incentive to regularly attend and consistently improve their JavaScript programming.

So a bimonthly programme, initially running for 3 months, it would give people a good run at meeting mentors, having a specific regular time with mentors and peers and improving their JavaScript – and hopefully inspire them to continue thinking about what the mentors have taught them and look at working on the tasks in their spare time as well as during sessions.

As always, any suggestions or comments gratefully received. Happy coding!


JavaScript Code Club

Update: We have a website – – register interest and we’ll see if I can get the London faction off the ground very soon!

Since I am generally not brilliant at JavaScript, in fact my code generally sucks, I’m thinking about curating some form of beginners class.

While I have lots of books on JavaScript and the like, I really find it difficult to digest them sometimes, with completing exercises just being a case of copying code and not *really* digesting what it’s doing.

Since almost all the developers I know are really helpful and keen to share their knowledge and the fact I learn much better when things are explained to me by a real person, I thought why not invest my time into getting like minded people together to help each other learn JavaScript, while being helped by the wonderful people I know that rock at JS development. Some of them have even written books for goodness sake.

The format I have in mind would be ‘pupils’ meeting with a guest ‘tutor’ twice a month. Session one would cover some essential knowledge in a short lesson, followed by an assignment being set.

‘Pupils’ will then go away with their assignment and a little bit more knowledge, before returning 2 weeks later to talk about their methodology and solution, with the tutor giving advice and helping fix any bugs in this session, before demonstrating how they would have solved the problem.

I’m going to work out what format might work best, and I will be following some way of learning JS anyway, but I though if anyone is interested in learning JavaScript from the ground up, from a real person, while solving real problems it might be worth trying to get a group together.

Please let me know in the comments if you are interested and I’ll start to investigate what the possibilities are.

Unless I work out some way of working out a remote format – this will be based in London, UK – although no reason it can’t work without being there in person.

Suggestions to format or other ideas also welcome!


How to list pages and content in Perch CMS

Today, @foamcow on twitter was asking how to list snippets of pages on Perch. So I thought I would have a break and list how I did it – which may not be the best method, but it worked for me.

I had pages with perch content fields, with, for the reason of this example, we’ll call Heading a plain text field, Image (image field) and a Content (textarea).

Initially I though I was stuck, but the forums told me to list the pages I need based on the navigation functions, so in brief, here’s how I did it. Apologies for lack of syntax highlighting etc, will add that later!

< ?php // Let's get the list of pages according to the navigation first. // Restrict to the path we need, which is only pages in /projects/ // skip-template means we just get an array of the page data back. $navigation = perch_pages_navigation(array( 'from-path' => '/projects/',
'levels' => 1,
'skip-template' => true

// Now let's loop through the perch content in the project page template
foreach( $navigation as $item ) {

// Add Skip template so we can use the data
$opts = array(
'page' => $item['pagePath'], // This is where we use the data from the nav list to get each page in turn
'skip-template' => true

// Now get an array of data for each perch content area in the page template
// All using the same options array we just set using the nav pagePath
$data = perch_content_custom('Heading', $opts);
$desc = perch_content_custom('Content', $opts);
$images = perch_content_custom('Image', $opts);

<!-- This bit was more complicated for me - print_r your own array to work out what array index you need. -->
<a href="< ?php echo $item['pagePath'];?>">
<img src="/perch/resources/< ?php echo $images[0]['image']['sizes']['w684h386c1']['path']; ?>" alt="" />

<h2><a href="< ?php echo $item['pagePath'];?>">< ?php echo $data[0]['text']; ?></a></h2>
<p>< ?php echo $desc[0]['text']; ?> <a href="< ?php echo $item['pagePath'];?>">More</a></p>


< ?php } // foreach ?>

And hopefully that should work – but if not it has the basic theory. You can flag items by adding another suppressed field to the project page template and then checking the value in the for loop, which I have done before, although there may be a more efficient way to do that.

My Anywhere Working Tips

Since going freelance I have had the opportunity to work in all manner of places, from in small coffee shops to multi million pound agency premises.

During this time I have learn a lot about working from anywhere, so here are my top 5 tips. Hope they help you as much as they help me.

  1. Plan location times in advance. If you know that you have a long day ahead of you – find somewhere that won’t kick you out in the middle of a complex tax. Nothing worse than being 30 minutes from finishing a project and Starbucks closes in ten minutes. Use a natural break to move early and find an alternative.
  2. Keep a spare. Of EVERYTHING business critical. I have 2 Macs, my old one I could have sold, but I have kept it and it serves as a back up machine. If my day to day machine dies at 9pm, with a deadline to hit, it isn’t the end of the world.
  3. Use CVS/Back up everything. I use Git. In tandem with the last post, make sure that all your code is backed up, versioned and always safe. And commit every change. Even if it only serves to remind you how you did something in a month or three.
  4. Talk to people. There is far too much value in talking to people, learning from them and just generally relaxing from your focussed task fro a few minutes. You may find advice, opinion and driection from the most unlikely sources.
  5. Don’t work. Just because you can work remotely, doesn’t mean you always have to be on the clock. Set your own hours by all means, but if you spend all your time being available and ready to work, you’re not living your life. Remember, my favourite saying: “Work to live, don’t live to work.”

Now – I better get back to work! Or pop into my kitchen for a snack and a coffee. Life is good.