-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made the tower fireworks from created to working state the tower is c…
…urrently spawned in and is using the fireworks projectile and the tower combat has been modified for the charging start and end states created animation controller, atlas files, sprite sheet for the animations.(current tower state : almost finished)
- Loading branch information
1 parent
0386c95
commit cacf4fc
Showing
8 changed files
with
659 additions
and
33 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...e/core/src/main/com/csse3200/game/components/tower/FireworksTowerAnimationController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.csse3200.game.components.tower; | ||
|
||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
|
||
/** | ||
* This class listens to events relevant to DroidTower entity's state and plays the animation when one | ||
* of the events is triggered. | ||
*/ | ||
public class FireworksTowerAnimationController extends Component { | ||
private AnimationRenderComponent animator; | ||
|
||
/** | ||
* Creation call for a DroidAnimationController, fetches the animationRenderComponent that this controller will | ||
* be attached to and registers all the event listeners required to trigger the animations and sounds. | ||
*/ | ||
@Override | ||
public void create() { | ||
super.create(); | ||
animator = this.entity.getComponent(AnimationRenderComponent.class); | ||
entity.getEvents().addListener("idleStart", this::animateDefault); | ||
entity.getEvents().addListener("chargeStart", this::animateChargeStart); | ||
entity.getEvents().addListener("chargeEnd", this::animateChargeEnd); | ||
entity.getEvents().addListener("attackStart", this::animateAttack); | ||
entity.getEvents().addListener("deathStart", this::animateDeath); | ||
|
||
} | ||
|
||
/** | ||
* the towers starts charging to shoot a projectile | ||
*/ | ||
void animateChargeStart() { | ||
animator.startAnimation("Charge"); | ||
} | ||
|
||
/** | ||
* the towers starts charging to shoot a projectile and after that this | ||
* animation is the wind down of that charging up of the tower | ||
*/ | ||
void animateChargeEnd() { | ||
animator.startAnimation("Charge_end"); | ||
} | ||
|
||
/** | ||
* THIS IS TO SHOW THE TOWER DEATH IN THIS SITUATION THE TOWER GETS BLASTED | ||
*/ | ||
void animateAttack() { | ||
animator.startAnimation("Attack"); | ||
} | ||
|
||
|
||
void animateDeath() { | ||
animator.startAnimation("Death"); | ||
} | ||
|
||
|
||
/** | ||
* Triggers the "default" or "Idle animation for the entity. | ||
* This method should be invoked when the entity returns to its default state. | ||
*/ | ||
void animateDefault() { | ||
animator.startAnimation("Idle"); | ||
} | ||
|
||
|
||
} |
7 changes: 7 additions & 0 deletions
7
source/core/src/main/com/csse3200/game/entities/configs/HealTowerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.csse3200.game.entities.configs; | ||
|
||
public class HealTowerConfig { | ||
public int health = 1; | ||
public int baseAttack = 0; | ||
public int cost = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters