jplay
Class GameObject

java.lang.Object
  extended by jplay.GameObject
Direct Known Subclasses:
GameImage, TileInfo

public class GameObject
extends java.lang.Object

The most basic class presents in the framework. Base class for almost all classes of this framework.


Field Summary
 int height
          The height in pixels of the image.
 int width
          The width in pixels of the image.
 double x
          Image position on the screen.
 double y
          Image position on the screen.
 
Constructor Summary
GameObject()
          Create a GameObject positioned in the x =0, y=0, and its dimension is width = 0 and height = 0.
 
Method Summary
 boolean collided(GameObject obj)
          Method used for knowing if a GameObject collided with other GameObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
Image position on the screen. Axis x (horizontal). When its value is used for drawing it's converted to an integer.


y

public double y
Image position on the screen. Axis y (vertical). When its value is used for drawing it's converted to an integer.


width

public int width
The width in pixels of the image.


height

public int height
The height in pixels of the image.

Constructor Detail

GameObject

public GameObject()
Create a GameObject positioned in the x =0, y=0, and its dimension is width = 0 and height = 0.

Method Detail

collided

public boolean collided(GameObject obj)
Method used for knowing if a GameObject collided with other GameObject.

Parameters:
GameObject - Target GameObject to verify if there was a collision.
Returns:
boolean - true if collided, false otherwise.