Package struct
Class CharacterData
java.lang.Object
struct.CharacterData
The class dealing with data on the character such as the character's HP,
energy, coordinates.
-
Field Summary
Modifier and TypeFieldDescriptionprivate Action
The character's action.private AttackData
The attack data that the character is using.private int
The character's hit box's most-bottom y-coordinate.private boolean
The flag whether this character can run a new motion with the motion's command.
true
if the character can run,false
otherwise.private int
The character's energy.private boolean
The character's facing direction.
true
if the character is facing right,false
otherwise.private int
The amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.private int
The character's graphic width.private int
The character's graphic height.private boolean
The flag whether the motion hits the opponent or not.private int
The continuous hit count of attacks used by this character.private int
The character's HP.private int
The frame number of the last frame that an attack used by this character hit the opponent.private int
The character's hit box's most-left x-coordinate.private boolean
The character's side flag.
true
if the character is P1, orfalse
if P2.private int
The number of frames that the character needs to resume to its normal status.private int
The character's hit box's most-right x-coordinate.private int
The character's horizontal speed.private int
The character's vertical speed.private State
The character's state: STAND / CROUCH / AIR / DOWN.private int
The character's hit box's most-top y-coordinate.private int
The character graphic's most top-left x-coordinate.private int
The character graphic's most top-left y-coordinate. -
Method Summary
Modifier and TypeMethodDescriptionReturns the character's action.Returns the attack data that the character is using.int
Returns the character's hit box's most-bottom y-coordinate.int
Returns the character's hit box's center x-coordinate.int
Returns the character's hit box's center y-coordinate.int
Returns the character's energy.int
Returns the amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.int
Returns the character's graphic width.int
Returns the character's graphic height.int
Returns the continuous hit count of attacks used by this character.int
getHp()
Returns the character's HP.int
Returns the frame number of the last frame that an attack used by this character hit the opponent.int
getLeft()
Returns the character's hit box's most-left x-coordinate.int
Returns the number of frames that the character needs to resume to its normal status.int
getRight()
Returns the character's hit box's most-right x-coordinate.int
Returns the character's horizontal speed.int
Returns the character's vertical speed.getState()
Returns the character's state: STAND / CROUCH/ AIR / DOWN.int
getTop()
Returns the character's hit box's most-top y-coordinate.int
getX()
Deprecated.int
getY()
Deprecated.boolean
Returns the flag whether this character can run a new motion with the motion's command.boolean
isFront()
Returns the character's facing direction.boolean
Returns the flag whether the motion hits the opponent or not.boolean
Returns the character's side flag.void
Sets the character's action.void
setAttack
(AttackData attack) Sets the character's attack.void
setBottom
(int bottom) Sets the character's hit box's most-bottom y-coordinatevoid
setControl
(boolean control) Sets the flag whether this character can run a new motion with the motion's command.void
setEnergy
(int energy) Sets the character's energy.void
setFront
(boolean front) Sets the character's facing direction.void
setHitConfirm
(boolean hitConfirm) Sets a boolean value whether the motion hits the opponent or not.void
setHitCount
(int hitCount) Sets the continuous hit count of attacks used by this character.void
setHp
(int hp) Sets the character's HP.void
setLastHitFrame
(int lastHitFrame) Sets the frame number of the last frame that an attack used by this character hit the opponent.void
setLeft
(int left) Sets the character's hit box's most-left x-coordinatevoid
setRemainingFrame
(int remainingFrame) Sets the number of frames that the character needs to resume to its normal status.void
setRight
(int right) Sets the character's hit box's most-right x-coordinate.void
setSpeedX
(int speedX) Sets the character's horizontal speed.void
setSpeedY
(int speedY) Sets the character's vertical speed.void
Sets the character's state.void
setTop
(int top) Sets the character's hit box's most-top y-coordinatevoid
setX
(int x) Sets the character's horizontal position.void
setY
(int y) Sets the character's vertical position.
-
Field Details
-
playerNumber
private boolean playerNumberThe character's side flag.
true
if the character is P1, orfalse
if P2. -
hp
private int hpThe character's HP. -
energy
private int energyThe character's energy. -
x
private int xThe character graphic's most top-left x-coordinate. -
y
private int yThe character graphic's most top-left y-coordinate. -
left
private int leftThe character's hit box's most-left x-coordinate. -
right
private int rightThe character's hit box's most-right x-coordinate. -
top
private int topThe character's hit box's most-top y-coordinate. -
bottom
private int bottomThe character's hit box's most-bottom y-coordinate. -
speedX
private int speedXThe character's horizontal speed. -
speedY
private int speedYThe character's vertical speed. -
state
The character's state: STAND / CROUCH / AIR / DOWN. -
action
The character's action. -
front
private boolean frontThe character's facing direction.
true
if the character is facing right,false
otherwise. -
control
private boolean controlThe flag whether this character can run a new motion with the motion's command.
true
if the character can run,false
otherwise. -
attackData
The attack data that the character is using. -
remainingFrame
private int remainingFrameThe number of frames that the character needs to resume to its normal status. -
hitConfirm
private boolean hitConfirmThe flag whether the motion hits the opponent or not.true
if the motion hits the opponent,false
otherwise. -
graphicSizeX
private int graphicSizeXThe character's graphic width. -
graphicSizeY
private int graphicSizeYThe character's graphic height. -
graphicAdjustX
private int graphicAdjustXThe amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character. -
hitCount
private int hitCountThe continuous hit count of attacks used by this character. -
lastHitFrame
private int lastHitFrameThe frame number of the last frame that an attack used by this character hit the opponent.
-
-
Method Details
-
isPlayerNumber
public boolean isPlayerNumber()Returns the character's side flag.- Returns:
true
if the character is P1, orfalse
if P2
-
isFront
public boolean isFront()Returns the character's facing direction.- Returns:
true
if the character is facing right,false
otherwise
-
isControl
public boolean isControl()Returns the flag whether this character can run a new motion with the motion's command.- Returns:
true
if the character can run,false
otherwise
-
getHp
public int getHp()Returns the character's HP.- Returns:
- the character's HP
-
getEnergy
public int getEnergy()Returns the character's energy.- Returns:
- the character's energy
-
getX
public int getX()Deprecated.Returns the character graphic's most top-left x-coordinate.- Returns:
- the character graphic's most top-left x-coordinate
-
getY
public int getY()Deprecated.Returns the character graphic's most top-left y-coordinate.- Returns:
- the character graphic's most top-left y-coordinate
-
getLeft
public int getLeft()Returns the character's hit box's most-left x-coordinate.- Returns:
- the character's hit box's most-left x-coordinate
-
getRight
public int getRight()Returns the character's hit box's most-right x-coordinate.- Returns:
- the character's hit box's most-right x-coordinate
-
getTop
public int getTop()Returns the character's hit box's most-top y-coordinate.- Returns:
- the character's hit box's most-top y-coordinate
-
getBottom
public int getBottom()Returns the character's hit box's most-bottom y-coordinate.- Returns:
- the character's hit box's most-bottom y-coordinate
-
getCenterX
public int getCenterX()Returns the character's hit box's center x-coordinate.- Returns:
- the character's hit box's center x-coordinate
-
getCenterY
public int getCenterY()Returns the character's hit box's center y-coordinate.- Returns:
- the character's hit box's center y-coordinate
-
getSpeedX
public int getSpeedX()Returns the character's horizontal speed.- Returns:
- the character's horizontal speed
-
getSpeedY
public int getSpeedY()Returns the character's vertical speed.- Returns:
- the character's vertical speed
-
getState
Returns the character's state: STAND / CROUCH/ AIR / DOWN.- Returns:
- the character's state: STAND / CROUCH/ AIR / DOWN
- See Also:
-
getAction
Returns the character's action.- Returns:
- the character's action
- See Also:
-
getRemainingFrame
public int getRemainingFrame()Returns the number of frames that the character needs to resume to its normal status.- Returns:
- the number of frames that the character needs to resume to its normal status
-
getAttack
Returns the attack data that the character is using.- Returns:
- the attack data that the character is using
- See Also:
-
getGraphicSizeX
public int getGraphicSizeX()Returns the character's graphic width.- Returns:
- the character's graphic width
-
getGraphicSizeY
public int getGraphicSizeY()Returns the character's graphic height.- Returns:
- the character's graphic height
-
getGraphicAdjustX
public int getGraphicAdjustX()Returns the amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.- Returns:
- the amount of movement in the horizontal direction used to adjust the x coordinate
-
isHitConfirm
public boolean isHitConfirm()Returns the flag whether the motion hits the opponent or not.- Returns:
true
if the motion hits the opponent,false
otherwise
-
getHitCount
public int getHitCount()Returns the continuous hit count of attacks used by this character.- Returns:
- the continuous hit count of attacks used by this character
-
getLastHitFrame
public int getLastHitFrame()Returns the frame number of the last frame that an attack used by this character hit the opponent.- Returns:
- the frame number of the last frame that an attack used by this character hit the opponent
-
setHp
public void setHp(int hp) Sets the character's HP.- Parameters:
hp
- the amount of HP
-
setEnergy
public void setEnergy(int energy) Sets the character's energy.- Parameters:
energy
- the amount of energy
-
setX
public void setX(int x) Sets the character's horizontal position.- Parameters:
x
- the character's horizontal position
-
setY
public void setY(int y) Sets the character's vertical position.- Parameters:
y
- the character's vertical position
-
setSpeedX
public void setSpeedX(int speedX) Sets the character's horizontal speed.- Parameters:
speedX
- the character's horizontal speed
-
setSpeedY
public void setSpeedY(int speedY) Sets the character's vertical speed.- Parameters:
speedY
- the character's vertical speed
-
setState
Sets the character's state.- Parameters:
state
- a given state- See Also:
-
setAction
Sets the character's action.- Parameters:
action
- a given action- See Also:
-
setFront
public void setFront(boolean front) Sets the character's facing direction.- Parameters:
front
- the character's facing direction.true
if the character is facing right,false
otherwise.
-
setControl
public void setControl(boolean control) Sets the flag whether this character can run a new motion with the motion's command.- Parameters:
control
- the flag whether this character can run a new motion with the motion's command.true
if the character can run,false
otherwise.
-
setRemainingFrame
public void setRemainingFrame(int remainingFrame) Sets the number of frames that the character needs to resume to its normal status.- Parameters:
remainingFrame
- the number of frames that the character needs to resume to its normal status you want to set
-
setTop
public void setTop(int top) Sets the character's hit box's most-top y-coordinate- Parameters:
top
- the integer value you want to set
-
setBottom
public void setBottom(int bottom) Sets the character's hit box's most-bottom y-coordinate- Parameters:
bottom
- the integer value you want to set
-
setLeft
public void setLeft(int left) Sets the character's hit box's most-left x-coordinate- Parameters:
left
- the character's hit box's most-left x-coordinate you want to set
-
setRight
public void setRight(int right) Sets the character's hit box's most-right x-coordinate.- Parameters:
right
- the character's hit box's most-right x-coordinate you want to set
-
setAttack
Sets the character's attack.- Parameters:
attack
- the attack you want to set- See Also:
-
setHitCount
public void setHitCount(int hitCount) Sets the continuous hit count of attacks used by this character.- Parameters:
hitCount
- the continuous hit count of attacks used by this character
-
setLastHitFrame
public void setLastHitFrame(int lastHitFrame) Sets the frame number of the last frame that an attack used by this character hit the opponent.- Parameters:
lastHitFrame
- the frame number of the last frame that an attack used by this character hit the opponent
-
setHitConfirm
public void setHitConfirm(boolean hitConfirm) Sets a boolean value whether the motion hits the opponent or not.- Parameters:
hitConfirm
- a boolean value whether the motion hits the opponent or not.true
if the motion hits the opponent,false
otherwise.
-
getLeft()
orgetRight()
orgetCenterX()
instead