Class GameObject
java.lang.Object
com.edu.xmum.CST210.Model.AbstractClass.GameObject
- Direct Known Subclasses:
AiModel,MazeModel,PlayerModel
The superclass of all objects in the game.
Specifies properties that all game objects should have:
1. Horizontal coordinate: x
2. Vertical coordinate: y
Specifies the methods that all game objects should have: 1. Getter and setter methods for x and y coordinates
-
Constructor Summary
ConstructorsConstructorDescriptionGameObject(int x, int y) Constructor to initialize the coordinates of the game object. -
Method Summary
-
Constructor Details
-
GameObject
public GameObject(int x, int y) Constructor to initialize the coordinates of the game object.- Parameters:
x- The horizontal coordinate.y- The vertical coordinate.
-
-
Method Details
-
getX
public int getX()Gets the horizontal coordinate.- Returns:
- The x-coordinate.
-
setX
public void setX(int x) Sets the horizontal coordinate.- Parameters:
x- The x-coordinate.
-
getY
public int getY()Gets the vertical coordinate.- Returns:
- The y-coordinate.
-
setY
public void setY(int y) Sets the vertical coordinate.- Parameters:
y- The y-coordinate.
-