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 classSpaceshipAttackController.AttackTypeSpaceship attack typestatic classSpaceshipAttackController.SpaceshipAttackSpaceship attack state - 
Field Summary
Fields Modifier and Type Field Description static Vector2positionHitSpaceshipstatic SpaceshipAttackController.SpaceshipAttackspaceshipState - 
Constructor Summary
Constructors Constructor Description SpaceshipAttackController() - 
Method Summary
Modifier and Type Method Description voidcreate()Called when the entity is created and registered.static SpaceshipAttackController.SpaceshipAttackgetSpaceshipState()Get spaceshipState, used for test.SpaceshipAttackControllersetPlayer(Entity player)Set player entity, used with addComponent.static voidsetSpaceshipAttack()Generate monsters based on the position of the enemy monkey, which is called by render().static voidsetSpaceshipState(SpaceshipAttackController.SpaceshipAttack spaceshipState)Set the state of the spacecraft, use it when testingvoidupdate()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:ComponentCalled 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:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. 
 -