From Immersive Visualization Lab Wiki
Revision as of 23:19, 9 April 2020 by Jschulze (Talk | contribs)

Jump to: navigation, search


VR Whack-a-Mole

In this first programming project you need to create a simple Whack-a-Mole game for your smartphone with your VR viewer.

The idea of the game is to find the highlighted sphere among a 2D array of spheres, and click on it. The player has 15 seconds to click on as many highlighted spheres as possible.

Due Dates

Project due date is Sun, April 19 @ 11:59 PM PST

Milestone #1: Fri, April 10 - Students should have a built and run an application on their chosen platform with a basic scene by now.

Milestone #2: Fri, April 17 - Students should have finished their scene and gaze interaction system and be working on core gameplay features

Project (100 Points)

Download Unity and do a Unity tutorial. Learn how to make Unity apps for smartphones and build an app (any app at this point) that runs on your smartphone. (10 points)

We recommend this tutorial from our edX course CSE 190x.

Use Unity to develop a VR application for your smartphone which implements a simple Whack-a-Mole inspired game.

Here are step by step instructions for it:

  • Create a thin box that you use as a wall as the backdrop of your application. The wall's height should be approximately equal to your vertical field of view.
  • Take a picture of your surroundings (indoor or outdoor) with your smartphone and import it into Unity as a texture asset. You are welcome to creatively process the image with an image processing tool.
  • Paste the picture onto the wall so that it faces the user.
  • Create and place a 3D array of 5x5 = 25 spheres in front of the wall. Each sphere should be the size of a tennis ball (0.07 meters diameter), and the balls' center points should be 0.14 meters apart from each other (horizontally and vertically).
  • Create C# code to highlight a random sphere in a different color.
  • Create a cursor (e.g., a line, small sphere snapping to closest object, etc.) to allow the user to select a sphere by pointing their head at it.
  • Start the game when the user pushes the action button. This should start a 15 second timer, which does not need to be displayed visually (see extra credit).
  • When the user clicks the button on the viewer, check if they hit the highlighted sphere and if so draw a copy of the sphere above or off to the side of the play area as a counter for how many spheres have been hit.
  • Un-highlight the selected sphere and highlight a different one.
  • If the user clicks on a sphere other than the highlighted one, the click should be ignored.
  • Repeat the above until the timer is up. Then highlight all spheres at once.

Here's a mock-up of what the game could look like:


Once you are done implementing the project, try to get it working on your phone with your VR headset. This part is optional.

Finally, record a video off the screen while you play the game from start to finish. Make sure you include a shot of your final score. Upload the video to Canvas by the deadline. Also, add a comment stating which parts of the project you got done or didn't get done.

To create the video you don't need to use video editing software, but you should use software to capture your screen to a video file. To record off your desktop computer, we recommend OBS Studio, which is available free of charge for Windows and Mac. For smartphone recording these tips may be useful:

  • On Iphones screen recording should be very easy.
  • Newer Samsung Galaxy phones with the Game Tools feature have a built-in screen recording mode that is disabled by default. Find out here how to enable and use it.
  • The Mobizen Screen Recorder app should work on every Android phone. The free version comes with a watermark, which is acceptable.

Extra Credit (Max. 10 Points)

Options for extra credit are:

  • Display text in the app:
    • Instead of displaying the score as a number of spheres, display the number of "whacked moles" as text within the VR environment.
    • Display a message prompting the user to start the game
    • Display a countdown timer that shows the remaining seconds in the game
    • Display a message that the game is over, along with the number of correctly clicked spheres. (10 points)
  • Instead of (or in addition to) highlighting the sphere that is to be clicked on, wrap a picture of a mole around it as a texture (5 points), or find (5 points) or create (10 points) a 3D model of a mole and load it instead of the spheres (10 points).
  • New game play: come up with a game that also involves clicking on things but is more fun than the homework project. (up to 10 points)