public interface GameObject
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g2d)
This method draws the object.
|
java.awt.geom.Point2D.Double |
getCenter()
This method gets the center as a point.
|
java.awt.geom.Point2D.Double |
getDirection()
This method gets the direction as a point.
|
int |
getHealthPoints()
This method returns the number of HP.
|
double |
getHeight()
This method gets the height of the sprite.
|
java.awt.image.BufferedImage |
getImage()
This method gets the sprite (BufferedImage).
|
java.awt.geom.Point2D.Double |
getPosition()
This method get the position.
|
double |
getWidth()
This method gets the width of the sptie.
|
double |
getXCenter()
This method gets the center on x-axis.
|
double |
getXDirection()
This method get the directoin on x-axis.
|
double |
getXPosition()
This method get the position on x-axis.
|
double |
getXVelocity()
This method get the velocity on x-axis.
|
double |
getYCenter()
This method get the center on y-axis.
|
double |
getYDirection()
This method get the directoin on y-axis.
|
double |
getYPosition()
This method get the position on y-axis.
|
double |
getYVelocity()
This method get the velocity on y-axis.
|
void |
gotHit()
The method informs the object that it's been hit to take appropriate action.
|
void |
initializeLocation()
This method is called when a game object is created and is ready to be given a location on a panel.
|
boolean |
isDead()
This method checks whether the object is dead or not.
|
void |
makeDead()
This method makes the object dead.
|
void |
move()
This method moves the object.
|
void |
moveDirection()
This method moves the object only in terms of direction (rotation).
|
void |
movePosition()
This method moves the object only in term of position.
|
void |
setDirection(java.awt.geom.Point2D location)
This method sets the direction from a point.
|
void |
setDirectionToward(java.awt.geom.Point2D location)
This method sets the directoin toward a point.
|
void |
setHealthPoints(int healthPoints)
This method sets the number of HP.
|
void |
setImage(java.awt.image.BufferedImage image)
This method sets the sprite (BufferedImage).
|
void |
setImageLocation(java.lang.String imageLocation)
This method sets the sprite given the location of the image.
|
void |
setPosition(java.awt.geom.Point2D.Double point)
This method sets the position.
|
void |
setXDirection(double xDirection)
This method sets the directoin on x-axis.
|
void |
setXPosition(double xPosition)
This method sets the position on x-axis.
|
void |
setXVelocity(double xVelocity)
This method sets the velocity on x-axis.
|
void |
setYDirection(double yDirection)
This method sets the directoin on y-axis.
|
void |
setYPosition(double yPosition)
This method sets the position on y-axis.
|
void |
setYVelocity(double yVelocity)
This method sets the velocity on y-axis.
|
void draw(java.awt.Graphics2D g2d)
g2d
- the Graphics2D to do the drawingvoid move()
void movePosition()
void moveDirection()
void initializeLocation()
double getXPosition()
void setXPosition(double xPosition)
xPosition
- the position on x-axisdouble getYPosition()
void setYPosition(double yPosition)
yPosition
- the position on y-axisjava.awt.geom.Point2D.Double getPosition()
void setPosition(java.awt.geom.Point2D.Double point)
point
- the positiondouble getXVelocity()
void setXVelocity(double xVelocity)
xVelocity
- the velocity on x-axisdouble getYVelocity()
void setYVelocity(double yVelocity)
yVelocity
- the velocity on y-axisdouble getXDirection()
void setXDirection(double xDirection)
xDirection
- the direction on x-axisdouble getYDirection()
void setYDirection(double yDirection)
yDirection
- the direction on y-axisjava.awt.geom.Point2D.Double getDirection()
void setDirection(java.awt.geom.Point2D location)
location
- a point containing the directionvoid setDirectionToward(java.awt.geom.Point2D location)
location
- a point containing the location of a point to set direction todouble getXCenter()
double getYCenter()
java.awt.geom.Point2D.Double getCenter()
java.awt.image.BufferedImage getImage()
void setImage(java.awt.image.BufferedImage image)
image
- the BufferedImage to be set as spritevoid setImageLocation(java.lang.String imageLocation)
imageLocation
- the path to the imagedouble getWidth()
double getHeight()
int getHealthPoints()
void setHealthPoints(int healthPoints)
healthPoints
- the number to set the HP asvoid gotHit()
boolean isDead()
void makeDead()