My visit to Koyoki video games in London

Hi guys, I visited a video games company’s office yesterday (actually the offices of three different companies but they were in the same building.)

I met the person that invited me at Chelmsford Jam (where I was demonstrating some of my projects.)  He’s called David Hasovic and he owns Koyoki Limited.  I thought he was great, and really enjoyed listening to all the things he was able to tell me about the work he does.

We started by seeing the rooftop terrace and then we got round to seeing the offices and having a look at the games.

When I first went into the Koyoki office, I was really surprised and pleased.  I’ve never been in a professional programmer’s office before, so it was exciting for me to see what it’s really like to work as a game developer.  I liked that they are a small company and that their office is nice and quiet – I’d love to work somewhere like that when I’m older.

It was interesting how everybody had their own part of the game that they work on in lots of detail, and to see how much information needs to be stored for various aspects of the game to work.  I got to see processes being used that I’ve only read about in books before too, so that was really interesting.

Everybody was friendly, and I was allowed to pull up a chair or stand next to people, to see what they were working on up close.  They explained to me what they were doing and answered some questions for me too.

The people in Koyoki games were developing a game called Forces of Freedom, which is an army type strategy game played on tablets or mobiles.  You can find it here:  It’s not the kind of game I would normally play because I’m 10 and there are guns and things in it, but I did get to try out a little bit to see how the program works.  I liked how the sound effects and speed your character is moving at are programmed to change depending on what terrain you’re on.  So if you’re on a bridge, you hear thudding footsteps, and if you’re climbing a hill, your character moves a bit slower – like you would do in real life.

It was a great experience to see how all the files and bits of code come together to create professional games like this, and to learn about how the processes work (e.g. how each person has responsibility for specific parts of the overall program.)

Another company I saw was creating an update for a game called Pocket Mortys (that is actually how it’s spelt, not a me making a typo), which is based on an episode of a TV show called Rick and Morty (you can view the trailer for the app here).  They let me have a go on the apps they were developing as well.

At the end of my visit, David gave me a free book about Refactoring my code to take home with me.  It’s a really big book that I’m looking forward to reading!  I love computer programming manuals and this one should help me to understand how to get my own code to work as best as it can.

I’m feeling inspired to try and set up my own network after my visit, as that’s not something I’ve done before.  I’ll keep you guys posted when I’ve made a start on that. Thank you to David Hasovic for inviting me, and to everyone for being so friendly and helpful.  I learnt a lot and really enjoyed my visit!

Below: Pictures of my visit


Find the block game

Hi guys, I’ve just written a find the block game in minecraft pi that uses the gpio pins. It uses the pins to power LEDs that tell you how close you are to the block. The game tells you how to play before the main part starts.

To play this game, you need to connect some LEDs to the pins, the LED colours and the pins to connect them to are in the table below (Instructions are written for a raspberry pi B+/2/3 so consult your own raspberry pi leaf diagram if your raspberry pi is different):

GPIO pin Led colour
2 Red
3 Yellow
4 Green

You can download my program here.

Install and run is simple, set up the circuit (Remember to use resistors with the LEDs), make sure you have python and RPi.GPIO installed, and run the program normally (Make sure you have Minecraft pi open and a world loaded before running).

The video below is of the game in action.

I hope you enjoy playing my game.

Completing my ECDL

Yesterday, I completed the last 2 exams for my ECDL (ECDL stands for European Computer Driving License). It was only meant to be my penultimate exam (Excel), but after I’d finished that we asked if I could sit the last one (improving productivity)  as well and just pay another exam fee.

I passed both of these exams and my overall score equates to an A* GCSE, bet that’ll look good on my CV, especially as I did it at 10!

I completed the improving productivity exam in 15 minutes as well, the invigilator said that most students take the 1 hour that they are allowed to use for the test.

I’m feeling very pleased with myself for this achievement, and I hope I achieve more things like this in the future.

Programming a Lego mindstorm

Someone recently lent me their Lego mindstorm for me to have a play around with, and I’ve loved it.

I’ve mostly been programming it via bluetooth, because bluetooth is quick and easy to set up and use as long as you are able to interface with it using a computer. I’ve written a couple programs for it already which I’ve listed below:

  1. Anger.ev3:
    Makes the robot happy until you press the center click button on the robot, then it starts making noise, charging forward, and frantically moving anything on it that’s connected to a motor.
  2. Battle.ev3:
    Allows the robot to be controlled using a special remote; the controls are as follows:

    Button pressed What it does
    Top button Puts the robot to sleep (stops the engine sound, changes the eyes displayed on the screen to shut eyes and plays a snoring sound until you press another button) (The robot won’t do anything until you wake it up)
     Top left button  Moves the robot forward and changes the eyes displayed to eyes that are wide open
     Top right button  Makes the robot turn around and changes the eyes displayed to narrowed eyes that are pointing in a certain direction
    Bottom left button  Swings its back weapon back and forth once while changing the eyes displayed to evil eyes and playing the sound of someone shouting “HEY YA!”
     Bottom right button  Opens and closes its claws twice while playing a SNAP! sound and displaying open eyelids with spirals in the middle
     Touch Sensor (On the robot)  Plays a power down sound, changes the mindstorm’s eyes to tired eyes and the exits the program (This only works if the robot is awake)
     Nothing (If not asleep)  Keeps the eyes displayed as angry eyes and plays an engine sound

Here is a video of my battle program running on my lego mindstorm

I wish I didn’t have to give the robot back next week as I’m enjoying it so much. Thanks to Kurt because he is part of the family that lent me the mindstorm and was the one who earned the money that was used to buy the mindstorm in the first place, you can visit his website at

Making my first game that uses the Xbox controller

I’m currently creating a game that uses the Xbox controller. The aim of the game is to keep your rocket ship alive for as long as you can by avoiding asteroids. I’m hoping to finish it in time for a jam that’s coming up soon, so that I can show it off there.

Check out the video below to see it running (as of version alpha_28_01_16):

I will write a new post with the download link after the game is finished.

Hacking an Xbox controller

I’ve managed to use an Xbox controller with my Raspberry Pi. This blog post will tell you about what I’ve managed to do with it and how to do it yourself.

What I’ve managed to do so far

I’ve managed to map the D-pad, and the A, B, X & Y buttons to keys on the keyboard so that they can be used by any application, and create a desktop icon that starts the driver

How you can do it yourself (on the Raspberry Pi)

  1. Type the following into a terminal window to update the cache and install the driver program (press enter after each line):
    sudo apt-get update
    sudo apt-get install xboxdrv
  2. Run this command to remove something that conflicts with the driver (You’ll have to run this once per boot):
    sudo rmmod xpad
  3. Run this command to start the driver and map the keys (You’ll have to run this with your desktop open):
    sudo xboxdrv --ui-clear --ui-buttonmap a=XK_Return,b=XK_Escape,x=XK_x,y=XK_y --ui-buttonmap dl=XK_Left,dr=XK_Right,du=XK_Up,dd=XK_Down

It’d be nice if we didn’t have to enter those two commands every time we wanted to use the controller so let’s write a script to do that for us

  1. Open a new file in your text editor and type in the following:
    sudo rmmod xpad
    sudo xboxdrv --ui-clear --ui-buttonmap a=XK_Return,b=XK_Escape,x=XK_x,y=XK_y --ui-buttonmap dl=XK_Left,dr=XK_Right,du=XK_Up,dd=XK_Down
  2. Save your file with a name that you’ll remember and recognize as a file for this purpose (like start-xbox-driver)
  3. Type the following in a terminal window to make it executable (replace pathToScript with the path to your script):
    sudo chmod +x pathToScript
  4. You can run the script by typing the following into a terminal window (again, replace pathToScript with the path to your script):
    bash pathToScript


I hope this is useful to anyone who wants to get started with using an Xbox controller with their Raspberry Pi and I’ll keep you updated when I do more with it.

What I’ve done and what I want to achieve

Hi everyone and have a happy new year! I thought it would be cool to share what I’ve done and achieved this year, and also what I’d like to achieve and do next year.

What I’ve achieved this year

  • I’ve built and programmed a pi robot
  • I’ve started a blog (This one)
  • I’ve created a cool minecraft program and got it featured in the The Magpi (my natural disasters program)
  • Highly commended award in astro pi and my code getting sent into space
  • Learned a bit of Java.

What I want to achieve next year

  • I want to pass my ECDL
  • I want to write more awesome programs
  • I want to upgrade my robot so that it is controlled over the web, has a live stream of what it currently sees with the option to stream that to your device for later use, and make it better equipped for some of the pi wars challenges so that I can enter it into Pi Wars
  • I want to get better at some of the other programming languages like Java and C.
  • I want to write a cool game.
  • I want to start writing installers for my programs so that all you need to do to get one of my programs is to run the installer (This would also be useful for making sure people agree to a copyright agreement).
  • I want to use raspberry pis with things using the GPIOs like some other people do.

I think I’ve done quite a lot of cool things this year and I want to do even more awesome things next year. I really liked my natural disasters code being featured in The MagPi and my code being sent up into space!

I think it would be great if you share what you’ve achieved this year and what you’d like to achieve next year in the comments section down below, I think it would be cool to see what you’ve all been up to.

How to Hack a Wii Remote (on the raspberry pi)

In this tutorial, I will be telling you how to hack a wii remote. I decided to do this because of a comment:

Can You Post The Code that you used for it & how to hack or reconfigure the wii remote? That would be awesome!


Step 1: Get yourself a bluetooth adapter (you can get one easily from ryanteck) and a Wii remote.

Step 2: Install the required libraries and drivers by typing the following commands into a terminal window:

sudo apt-get update
sudo apt-get install python-cwiid bluetooth

Step 3: Put your pi in discoverable mode by typing the following into a terminal window:

sudo hciconfig hci0 piscan

The code

This will go through each bit of python code to do different things on the wii remote.

Type this in import the library:
import cwiid

Type this in to connect to the wii remote:
wm = cwiid.Wiimote()
Once you run that line of code, make sure to put your remote in discoverable mode by pressing the 1 and 2 keys at the same time.

This line can fail and raise a RuntimeError if it fails to connect to the remote, so you’ll want to handle this and keep attempting to connect until you’re successful

Type this in to tell the wii remote to report back the button state:
wm.rpt_mode = cwiid.RPT_BTN

Press a button and type this in to get its value:

You can use the values for different buttons later to compare them with the value returned by this code in a program to see if a certain button is pressed.

Type this in to change the current leds lit on the wii remote:
wm.led = replace this value with led value
The led values go up in binary, ie. led 1 is 1, led 2 is 2, led 1 and 2 is 3, led 3 is 4, ect.

Type this in to make the wii remote vibrate:
wm.rumble = True
Replace the value True in the above code with False to make the wii remote stop vibrating.


I think that hacking a wii remote is quite easy once you know how to and I really hope this tutorial helped!

My code has been sent up into space!

I am so excited that my code has been sent into space!

I got a highly commended award in the Astro Pi competition, and the Astro Pi people had said that only the winner’s codes would be sent up into space; but last night, at the winner’s ceremony, they invited us highly commended winners along as well (there were three of us), and told us the amazing news. I can’t believe that they hid that from us!

Us highly commended winners getting told the fantastic news!

Last night was great, and as well as hearing the amazing news, I got something pretty cool – a plain Raspberry Pi printed circuit board!

My plain Pi printed circuit board

Today, there was a launch party and graduation ceremony at the science museum. The graduation ceremony was for the Astro Science Challenge, which I completed, so I received a certificate and special gold UNSA cadet pin badge for that.

After the schools and home educated children who attended had received their certificates, we were then able to watch Tim Peake’s launch on the giant IMAX screen!  It felt really exciting, and everybody clapped and cheered when Tim gave the camera a thumbs up, and a wave, and also when he actually took off of course.

Me and Mum at the award celebration
Us home ed children holding up the certificates we were given
Me and one of the presenters.