Steady Hand Game

Steady hand game introduction

The Steady hand game involves trying to get a metal wand from one side of a wavy wire to the other, without the two touching. The game works because it is made from an incomplete electrical circuit. When the metal wand touches the metal wire course, the circuit is completed and this triggers an alarm. CodeBug can sense when the circuit is completed using its legs, and can then tell the player that they have lost the game.

You will need
CodeBug CodeBug
Micro USB cable
Computer
Metal coat hanger
OR Plasticine
Blue-tac
CR2032 battery (optional)
Crocclips

  • Ask a new question:

Write your program

Your program should simply detect if leg 1 (attached to the wavy course) has been connected to the ground (GND) leg (attached to the metal wand). If this happens, you then need to scroll a message telling the player that the game is over.

Follow the tutorial below to create your program.


  • Ask a new question:

Create your course

The course consists of a metal wavy path and a metal wand.

  • Get an adult to break the loop of your coat hanger and then bend it into a fun shape.

  • Attach a crocclip to one end of your coat hanger and the other clip to leg 1 on CodeBug.

  • Make a wand with another piece of wire with a loop at one end. Feed the wire through the wand loop.

  • Use plasticine to secure the two ends of the wire course, creating two bases so the course stands upright.

  • Attach a crocclip from the end of your wand to the GND leg on CodeBug.

Make sure your metal wire and wand have no sharp edges!


1 Question
  • I experienced a lot of problems with the CodeBug thinking it's leg was grounded when there was no circuit. For example, if I attach one end of a crocodile clip to each of leg 1 and GND but don't attach the other end to anything and then just hold the unattached end of the crocodile clips attached to leg 1, the CodeBug scrolls the message in the If block. Simply attaching the 'clips to the course and the wand, when the wand is clearly not touching the course is sufficient for the CodeBug to think the leg is grounded. I have the same problem whether the CodeBug is powered by the USB cable or has a battery fitted. Any suggestions? Peter Wood @ Nov. 1, 2015, 11:01 a.m.


    Hi Peter, make sure CodeBug is not touching anything conductive when your course is set-up (some tablecloths can act as a ground). With regards to you holding the croc-clip, CodeBug has a feature to make it very sensitive to ground (so that it can detect an electrical circuit through people holding the legs) and sometimes people can act as grounds, especially if they are also touching something conductive like a tablecloth. To turn off the heightened sensitivity in your program, click on the cog on the Start block, drag in a 'leg pullup' block into the start block and set leg 1 to enable. I will add this to this guide, thanks for the feedback Thomas Macpherson-Pope @ Nov. 2, 2015, 9:45 a.m.

    Answer this question:

  • deleted


    Answer this question:

  • Ask a new question:

Extending your game

Your game now works, however if you’re not watching, a player can cheat the game, as it doesn’t make them go back to the start after they lose. To make your game cheat proof you need to detect when the game has been won, and also have a way to reset the game when it has been won or lost.

To do this you need to connect up some of CodeBugs other legs.

  • Push a croc-clip into each base (with part of the metal clip showing).

  • Connect the other ends of these two croc-clips to a different leg on CodeBug (use leg 3 for the start/reset and 2 for the end, like in the diagram below).

  • Make sure these new connections are not touching your wavy course, because this will cause your program to behave strangely.


  • Ask a new question:

Extending your program

Now your program needs to check if these extra clips have been touched and scroll a winning message if the winning ring has been touched, or continuously scroll "Game over" until the start/reset ring has been touched.

Follow the tutorial below to create your program.


  • Ask a new question:

What next

Follow the CodeBug block index activity to see if you can extend your program further, maybe add a counter to encourage players to complete the course quickly.. Or you could make a checkpoint in the middle of your course with a certain number of lives?

Take a picture of your crazy CodeBug course and share it with us via facebook or twitter, we love to see what you come up with.


  • Ask a new question:

Back to top