Introduction: X-mas HoloGame TfCD

Want to learn how to make a game with a holographic screen to impress your friends?

In this Instructable we make it possible. We provide the code for an interactive pong game, all you have to do is make trampolines (using ultrasonic distance sensors) to use as input. When you’re up for a challenge, you could change some things in the code, such as the pictures used, speed and the score system.

How does it work?

By combining graphics (using Processing) with Arduino hardware, it is possible to create an interactive game. Next, the game is projected by a phone on a transparent film using the pepper’s ghost effect. This technology uses a reflective film that acts like a mirror, but is transparent at the same time. When placing this above a lightened object or screen, this will be reflected by the film and look like a hologram.

Step 1: Software

Needed software:

  • Processing

If you don’t have processing, download at https://processing.org/download/.

  • Arduino

If you don’t have arduino, download at https://processing.org/download/.

  • Our code for the game (the enclosed zip file)

Step 2: Setting Up Processing

Search for “Minim Library” in Processing (this will enable the in-game music)

  1. click on “Sketch” in the menu bar at the top
  2. click ”Add Library”
  3. click “Import Library”
  4. search for “Minim” (see picture)

Download “GIF Library” for falling snow effect at https://github.com/01010101/GifAnimation.

To add this library manually, unzip it and copy it to the library folder of Processing, most likely at C:\Users\Documents\Processing\libraries. Make sure the name of this folder is GifAnimation.

Step 3: Setting Up the Secondary Display (for Pepper's Ghost Effect)

Set an Android phone (or tablet for larger screen) as secondary screen. The program that we used was Spacedesk. Download the program for your laptop at http://spacedesk.ph/download/ and download the app on your phone. To make the connection, both devices should be on the same Wifi network. You can search for the device or enter the IP address manually.

Step 4: Arduino Circuit

Prepare the following items:

  • 2 ultrasonic sensors
  • 1 Arduino
  • a breadboard
  • around 10 wires (make sure that they are long enough to go from the Arduino to your setup where you will be playing)

Build the circuit for Arduino based on the picture

Test it to see if the sensors work properly.

Step 5: Hardware Trampolines

Prepare the following items:

  • 2 balloons
  • scissors
  • tape
  • cardboard
  • the arduino circuit made in the previous step
  • a holder of 20 cm height with a round, open shape (we used toilet paper holders). This is because the ultrasonic sensors cannot be placed in a closed space due to resonance.

Assembly the 2 trampolines:

  1. blow up the balloon and deflate it so it has been stretched
  2. cut the balloon a bit below the widest point
  3. fit the balloon over the circular frame
  4. tape cardboard under the balloon
    as mentioned before, the rubber absorbs some of the signal of the ultrasonic sensor, the cardboard should obviate this.

  5. secure the ultrasonic sensors 20 cm beneath and directed at the balloon layer.
    It will measure the distance between the sensor and the balloon layer, so if you press the balloon with your finger, the distance will be smaller. Thus the program knows your character has to jump.

Note:

There were originally 2 levels of jumps based on the distance, however this made the game very hard to play. If you’re up for a challenge and the game is too easy for you, change lines 159 and 167, jump should be 1 instead of 2 (see below).

if (values[0] == 25 && jump ==0){

jump = 1;

}

if (values[1] == 25 && jump1 ==0){

jump1 = 1;

}

Step 6: Hardware Holoscreen

Prepare the following items:

  • cardboard box
  • cutter
  • metal ruler
  • cutting board
  • tape
  • transparent foil (with some stiffness)

Assembly the cardboard holoscreen:

  1. cut the cardboard as shown in the image. the ends with an angle of 45 degrees have a cut from the point till almost the end, this is to add the transparent film later on. (for a larger screen you can change the dimensions. the rectangle in the middle has to be at least the size of the screen you use. When changing the measurements, make sure that the transparent film is at a 45 degree angle)
  2. use tape to put it together
  3. put the connected phone in the box (set the screen locked on landscape. Place it in the way that the top of the screen is at the side of the box where the window is)
  4. add the transparent foil

Step 7: Connect & Play

  • Find a friend to play the game with
  • Put the holoscreen on eye level
  • Start the game

It is an option to just play it while using your laptop screen instead of the holoscreen.

However, then the images ‘homex’ and ‘menu’, which are in the zip file, need to be mirrored.