Jiadong Wu
  • Portfolio
  • Blog
  • Gallery
  • Lab
  • GitHub
  • About

Gravity Ball
An Android Game Based on Gravity Sensor

Demo

Introduction​

Ubiquitous computing(ubicomp), also known as pervasive computing, is a concept in software engineering and computer science where computing is made to appear anytime and everywhere. In contrast to desktop computing, ubiquitous computing can occur using any device, in any location, and in any format. [1] The common techniques that support ubicomp are  Internet, advanced middleware, operating system, mobile code, sensors, new I/O and user interfaces, networks, mobile protocols, location and positioning and so on. Also, with the widely use of mobile devices, cell phone is a suitable carrier to implement ubiquitous computing. Therefore, we intend to design an Android application with gravity sensor.

The Android application we designed is a game, called 
Gravity Ball. There are visible barriers and bombs to build a maze in each level. To finish a task on each level, users need move the ball from start position to assigned destination using gravity sensor embedded in the application.

​Design

Development Environment

This application is developed by Java under Android, and the development tool is Android Studio. 

Functions

This game is a level game, which contains 2 levels. Users have to finish them one by one to get the final victory. The inputs of this game or actions in the world are sensing gravity and button clicking. The gravity sensor collects the coordinate value and draws a new interface after processing the data. The corresponding outputs visible to users are moving the ball and triggering  the game state switching.
Picture
The above figure shows the initial interface of Gravity Ball game. The three icons represent that play, level option and get information about this game.
Picture
Picture
Here are the interface of entering two levels of this game. The gravity ball enters from the upper left corner of the screen and the destination is on the bottom right corner. Users need manipulate the ball to go to the destination, where a red flag locates on and they must avoid all bombs on the way as well.
Picture
Users are also able to pause the game when he/she is playing. They may resume/replay the game and go back to menu afterwards.
Picture
Picture
There are two states that can terminate the current level: complete or fail this level. If a user completes the current level, the game will display a interface like Figure 2.4 (a); or if the user fails, a interface like Figure 2.4 (b) will be displayed. Menu button will lead users to the interface shown in Figure 2.2; the upper right button will lead to replay the game; the bottom button in (a) will trigger the game of next level.
Picture
Gravity Ball game provides users an function to start with any level they want.

​Design Notes

Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions. These sensors are capable of providing raw data with high precision and accuracy.[2] There are three major categories of sensor: motion sensors, environment sensors and position sensors. Gravity sensor is included in the first category. We access it on the device and acquire raw sensor data by using Android sensor framework.

​Future Works

  1. This Gravity Ball game only has two levels, which is too limited, so that more possible levels should be designed to increase the complexity and difficulty to complete the game.
  2. Some potential methods to offer the effect mentioned above are:
  • Time limitation of each level;
  • Scoring mechanism through the whole game.

​References

  1. https://en.wikipedia.org/wiki/Ubiquitous_computing
  2. http://developer.android.com/guide/topics/sensors/sensors_overview.html

Keep Coding, Keep Living.

  • Portfolio
  • Blog
  • Gallery
  • Lab
  • GitHub
  • About