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
FieldsModifier and TypeFieldDescriptionprivate ActionThe character's action.private AttackDataThe attack data that the character is using.private intThe character's hit box's most-bottom y-coordinate.private booleanThe flag whether this character can run a new motion with the motion's command.
trueif the character can run,falseotherwise.private intThe character's energy.private booleanThe character's facing direction.
trueif the character is facing right,falseotherwise.private intThe amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.private intThe character's graphic width.private intThe character's graphic height.private booleanThe flag whether the motion hits the opponent or not.private intThe continuous hit count of attacks used by this character.private intThe character's HP.private intThe frame number of the last frame that an attack used by this character hit the opponent.private intThe character's hit box's most-left x-coordinate.private booleanThe character's side flag.
trueif the character is P1, orfalseif P2.private intThe number of frames that the character needs to resume to its normal status.private intThe character's hit box's most-right x-coordinate.private intThe character's horizontal speed.private intThe character's vertical speed.private StateThe character's state: STAND / CROUCH / AIR / DOWN.private intThe character's hit box's most-top y-coordinate.private intThe character graphic's most top-left x-coordinate.private intThe 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.intReturns the character's hit box's most-bottom y-coordinate.intReturns the character's hit box's center x-coordinate.intReturns the character's hit box's center y-coordinate.intReturns the character's energy.intReturns the amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.intReturns the character's graphic width.intReturns the character's graphic height.intReturns the continuous hit count of attacks used by this character.intgetHp()Returns the character's HP.intReturns the frame number of the last frame that an attack used by this character hit the opponent.intgetLeft()Returns the character's hit box's most-left x-coordinate.intReturns the number of frames that the character needs to resume to its normal status.intgetRight()Returns the character's hit box's most-right x-coordinate.intReturns the character's horizontal speed.intReturns the character's vertical speed.getState()Returns the character's state: STAND / CROUCH/ AIR / DOWN.intgetTop()Returns the character's hit box's most-top y-coordinate.intgetX()Deprecated.intgetY()Deprecated.booleanReturns the flag whether this character can run a new motion with the motion's command.booleanisFront()Returns the character's facing direction.booleanReturns the flag whether the motion hits the opponent or not.booleanReturns the character's side flag.voidSets the character's action.voidsetAttack(AttackData attack) Sets the character's attack.voidsetBottom(int bottom) Sets the character's hit box's most-bottom y-coordinatevoidsetControl(boolean control) Sets the flag whether this character can run a new motion with the motion's command.voidsetEnergy(int energy) Sets the character's energy.voidsetFront(boolean front) Sets the character's facing direction.voidsetHitConfirm(boolean hitConfirm) Sets a boolean value whether the motion hits the opponent or not.voidsetHitCount(int hitCount) Sets the continuous hit count of attacks used by this character.voidsetHp(int hp) Sets the character's HP.voidsetLastHitFrame(int lastHitFrame) Sets the frame number of the last frame that an attack used by this character hit the opponent.voidsetLeft(int left) Sets the character's hit box's most-left x-coordinatevoidsetRemainingFrame(int remainingFrame) Sets the number of frames that the character needs to resume to its normal status.voidsetRight(int right) Sets the character's hit box's most-right x-coordinate.voidsetSpeedX(int speedX) Sets the character's horizontal speed.voidsetSpeedY(int speedY) Sets the character's vertical speed.voidSets the character's state.voidsetTop(int top) Sets the character's hit box's most-top y-coordinatevoidsetX(int x) Sets the character's horizontal position.voidsetY(int y) Sets the character's vertical position.
-
Field Details
-
playerNumber
private boolean playerNumberThe character's side flag.
trueif the character is P1, orfalseif 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.
trueif the character is facing right,falseotherwise. -
control
private boolean controlThe flag whether this character can run a new motion with the motion's command.
trueif the character can run,falseotherwise. -
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.trueif the motion hits the opponent,falseotherwise. -
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:
trueif the character is P1, orfalseif P2
-
isFront
public boolean isFront()Returns the character's facing direction.- Returns:
trueif the character is facing right,falseotherwise
-
isControl
public boolean isControl()Returns the flag whether this character can run a new motion with the motion's command.- Returns:
trueif the character can run,falseotherwise
-
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:
trueif the motion hits the opponent,falseotherwise
-
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.trueif the character is facing right,falseotherwise.
-
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.trueif the character can run,falseotherwise.
-
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.trueif the motion hits the opponent,falseotherwise.
-
getLeft()orgetRight()orgetCenterX()instead