Department of Computer Science
Worcester Polytechnic Institute

CS-525H: Immersive Human-Computer Interaction
Project 1: Mobile Bomb Squad
Due: Monday, October 25, 2010 at 6pm

Objective: THIS PROJECT MAY BE DONE IN GROUPS OF TWO!

In this project, you will implement a multi-player game on the Android platform. The game will use built-in sensing and actuation on the Android to produce an immersive experience.


Game Design: The project objectives are for you to:
  1. familiarize yourself with programming on the Android platform,
  2. learn how to read Android sensors,
  3. learn how to provide visual, auditory, and tactile feedback on the Android, and
  4. learn how to map information you need to provide to the user with the different sensory displays, such that you can provide an immersive experience.
The goal of Mobile Bomb Squad is for two or more players to keep a smart bomb that you pass around from exploding.

Mobile Bomb Squad is made up of a series of levels, each one increasing in difficulty.

A level is made up of three parts: Touch Points, a Trigger Bubble, and Safety Zones.

To begin a level, a player must maintain contact with a set of Touch Points (filled colored circles). As long as she maintains contact, an outline circle representing a Safety Zone will be drawn. While keeping contact at the Touch Points, the player must tilt the Android in such a way as to keep the Trigger Bubble (a circle smaller than the Safety Zone) within the circle spacified as the Safety Zone.

Once both of these requirements are met, another set of Touch Points of a different color will appear, and the player must hand-off the Android to the second player by having him touch his fingers to the new Touch Points, all the time maintaining the attitude (tilt) of the Android, so as to keep the Trigger Bubble within the Safety Zone.

Once the second player has met these criteria, the first player can release her fingers from the touch points, the Safety Zone moves to a different location on the Android display, and the second player has a limited amount of time to re-tilt the Android to bring the Trigger Bubble into the new Safety Zone.

The game ends when the bomb explodes because of:

  • someone's finger coming off of a Touch Point when it shouldn't,
  • a player not bringing the Trigger Bubble into the Safety Zone within the alotted time, or
  • the Trigger Bubble leaving the Safety Zone when it shouldn't.
Exploding bombs should be accompanied by appropriate visual, auditory, and vibrotactile feedback.

To implement this game, you will need to provide several types of information to the players. These include:

  • visual filled colored circles for the Touch Points (two different colors),
  • a visual filled colored circle for the Trigger Bubble,
  • a visual outline colored circle for the Safety Zone (make it change color when the Trigger Bubble is safe),
  • a visual timer counting down the time to get the Trigger Bubble into the Safety Zone,
  • an audible (and vibrotactile) "tic" sound for the clock,
  • audible (and vibrotactile) "touch" and "release" sounds for the Touch Points,
  • an audible (and vibrotactile) "Ding!" sound for the Trigger Bubble entering the Safety Zone,
  • an audible (and vibrotactile) "Ping!" sound for the Safety Zone appearing, and
  • visual, auditory, and vibrotactile "explosion" media.

There are several variables that can be controlled to vary the difficulty of each level, including:

  • the number of Touch Points (start with a single Touch Point for the first couple of levels),
  • the size of the Safety Zone (start with relatively large Safety Zones),
  • the number of axes the player must tilt around (start with only requiring horizontal OR vertical tilt, then combine them in later levels),
  • the amount of time to get the Trigger Bubble into the Safety Zone,

What to do: For this project, you are going to build three subprojects, described below.
  1. Part 1: Multi-Touch Input
    In this part, you will make a simple application that detects multiple touches on the Android screen.
    The program should:
    1. clear the screen, and draw a filled rectangle representing the touch surface,
    2. display two filled circles, representing Touch Points, at different locations on the surface,
    3. detect when both Touch Points are being touched,
    4. play a sound and give brief vibrotactile feedback, and
    5. remove the two Touch Points, and draw two more at different locations on the surface.

    The application should continue indefinitely.

    Try to build this part of the program knowing that you will be growing it into your final application. There are several related sample apps on the Android Developer Site on the "Resources" tab, under "Sample Code"->"List of Samples". Also, on the "Reference" tab, under "android.view", the "MotionEvent" class will be of interest for getting the multi-touches.

  2. Part 2: Accelerometer Input
    In this part, you will make a simple application to read from the Android accelerometer, and update a circle on the screen. This should be a separate application from Part 1.
    The program should:

    1. clear the screen, and draw a filled rectangle representing the touch surface,
    2. display a filled circle, representing the Target Bubble, in the center of the screen, and
    3. continuously read the values from the accelerometer, and update the position of the circle based on the readings.

    Movement of the circle should be absolute, meaning if we assume a level Android to be zero degrees, then the circle would be in the middle of the screen. If we assume a 90-degree tilt as maximum for a given axis, then the circle would be displayed at the edge of the screen. An angle of 45 degrees would place the circle half way between the center and the corresponding edge. This should work for both axes.

    There are several related sample apps on the Android Developer Site on the "Resources" tab, under "Sample Code"->"List of Samples". Also, on the "Reference" tab, under "android.hardware", the "Sensor," "SensorEvent," and "SensorManager" classes will be of interest for getting accelerometer values.

  3. Part 3: Putting It All Together
    In this part, you will combine code from parts 1 & 2, and add the finishing touches to make the final application.
    The program should perform as stated in the "Game Design" part above.

    The "tricky" parts are probably going to be getting the game logic in place, workng with timers, and testing.


Attacking
the Problem:
Start early! I am a firm believer in front-loading as much work as possible on projects. The more you get done now, the fewer unknowns you will have about the project, and the sooner you'll start making significant progress.

As stated earlier, there is very good support on the Android Developer Site, including numerous tutorials. If you are new to Android development, I strongly suggest you work through the tutorials first, starting with the material on the "Dev Guide" tab.

Remember to start small. As I've done above, break down the individual parts into smaller, more-manageable pieces; don't try to solve the whole problem from the start.


What to Submit: All documents are to be submitted electronically via turnin by 6:00 pm on the day the assignment is due. Also, you will demonstrate your projects in class as well, so come prepared!

The following items should be submitted for this project:

  1. The code for each (sub)project part
  2. The code for the final application
  3. A brief description of your project. How do I run it? How do I play?
  4. A brief listing of what each teammember contributed to the project.
Name each file something that makes sense.

When you are ready to submit, zip up all your files into a single archive file.
Name the file Lastname1_Lastname2_proj1.zip, with the Lastnames being those of the teammembers.

You will use the Web-based "Turnin" facility to submit your work. Information about submitting can be found here:

http://web.cs.wpi.edu/~kfisler/turnin.html.

Your WPI user ID should be used to login, and you will be emailed a password.
The Turnin assignment ID is proj1.


Academic
Honesty:
Remember the policy on Academic Honesty: You may discuss the project with others, but you are to do your own work. The official WPI statement for Academic Honesty can be accessed HERE.


Back to course page.