com.WorldLibAndroid.Demo
Class BlobWorld

java.lang.Object
  extended by com.WorldLibAndroid.Demo.BlobWorld
All Implemented Interfaces:
IWorld

public class BlobWorld
extends java.lang.Object
implements IWorld

BlobWorld Class


Constructor Summary
BlobWorld()
          Contructor
 
Method Summary
 void draw(ICanvas c)
          With this method the user can draw on the canvas.
 void onGyroscopeEvent(float x, float y, float z)
          Performs an action when tilting the device by using the gyroscope.
 void onInit(IInit ii)
          With this method the user establish the initial values at bigBang.
 void onKeyEvent(int s)
          Move the Blob when the player presses a key
 void onOrientationEvent(float x, float y, float z)
          Performs an action when tilting the device by using the gyroscope.
 void onTick()
          On tick check whether the Blob is out of bounds, or fell into the black hole in the middle.
 void onTiltEvent(float x, float y, float z)
          Performs an action when tilting the device by using the accelerometer.
 void onTouchEvent(int x, int y)
          Performs an action when touching the screen of the device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobWorld

public BlobWorld()
Contructor

Method Detail

draw

public void draw(ICanvas c)
Description copied from interface: IWorld
With this method the user can draw on the canvas.

Specified by:
draw in interface IWorld
Parameters:
c - Canvas object to insert the figures to draw in.

onKeyEvent

public void onKeyEvent(int s)
Move the Blob when the player presses a key

Specified by:
onKeyEvent in interface IWorld
Parameters:
s - the key pressed

onTick

public void onTick()
On tick check whether the Blob is out of bounds, or fell into the black hole in the middle. If all is well, move the Blob in a random direction.

Specified by:
onTick in interface IWorld

onTouchEvent

public void onTouchEvent(int x,
                         int y)
Description copied from interface: IWorld
Performs an action when touching the screen of the device.

Specified by:
onTouchEvent in interface IWorld
Parameters:
x - coordinate of the touched area.
y - coordinate of the touched area.

onTiltEvent

public void onTiltEvent(float x,
                        float y,
                        float z)
Description copied from interface: IWorld
Performs an action when tilting the device by using the accelerometer.

Specified by:
onTiltEvent in interface IWorld
Parameters:
x - Acceleration minus Gx on the x-axis.
y - Acceleration minus Gy on the y-axis.
z - Acceleration minus Gz on the z-axis. Note: Get more information on Android's Sensors

onGyroscopeEvent

public void onGyroscopeEvent(float x,
                             float y,
                             float z)
Description copied from interface: IWorld
Performs an action when tilting the device by using the gyroscope.

Specified by:
onGyroscopeEvent in interface IWorld
Parameters:
x - Angular speed around the x-axis.
y - Angular speed around the y-axis.
z - Angular speed around the z-axis. Note: Get more information on Android's Sensors

onOrientationEvent

public void onOrientationEvent(float x,
                               float y,
                               float z)
Description copied from interface: IWorld
Performs an action when tilting the device by using the gyroscope.

Specified by:
onOrientationEvent in interface IWorld
Parameters:
x - Azimuth, angle between the magnetic north direction and the y-axis, around the z-axis (0 to 359). 0=North, 90=East, 180=South, 270=West.
y - Pitch, rotation around x-axis (-180 to 180), with positive values when the z-axis moves toward the y-axis.
z - Roll, rotation around y-axis (-90 to 90), with positive values when the x-axis moves toward the z-axis. Note: Get more information on Android's Sensors

onInit

public void onInit(IInit ii)
Description copied from interface: IWorld
With this method the user establish the initial values at bigBang.

Specified by:
onInit in interface IWorld
Parameters:
ii - object where we can establish the initial values.