Package com.deco2800.game.components.npc
Class SpaceshipAttackController
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.npc.SpaceshipAttackController
public class SpaceshipAttackController extends Component
This class deals with the scene of the spaceship attack. Control character position and provide global variables to
MainGameScreen.java to control camera movement.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpaceshipAttackController.AttackType
Spaceship attack typestatic class
SpaceshipAttackController.SpaceshipAttack
Spaceship attack state -
Field Summary
Fields Modifier and Type Field Description static Vector2
positionHitSpaceship
static SpaceshipAttackController.SpaceshipAttack
spaceshipState
-
Constructor Summary
Constructors Constructor Description SpaceshipAttackController()
-
Method Summary
Modifier and Type Method Description void
create()
Called when the entity is created and registered.static SpaceshipAttackController.SpaceshipAttack
getSpaceshipState()
Get spaceshipState, used for test.SpaceshipAttackController
setPlayer(Entity player)
Set player entity, used with addComponent.static void
setSpaceshipAttack()
Generate monsters based on the position of the enemy monkey, which is called by render().static void
setSpaceshipState(SpaceshipAttackController.SpaceshipAttack spaceshipState)
Set the state of the spacecraft, use it when testingvoid
update()
Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Field Details
-
Constructor Details
-
SpaceshipAttackController
public SpaceshipAttackController()
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
setPlayer
Set player entity, used with addComponent.- Parameters:
player
- Player entity.- Returns:
- self
-
setSpaceshipAttack
public static void setSpaceshipAttack()Generate monsters based on the position of the enemy monkey, which is called by render(). -
getSpaceshipState
Get spaceshipState, used for test.- Returns:
- the current state of spaceship attack.
-
setSpaceshipState
Set the state of the spacecraft, use it when testing- Parameters:
spaceshipState
- the state of the spaceship attack
-
update
public void update()Description copied from class:Component
Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
-