-
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.
Implemented the Dragon Knight Mob attack, run & death animation
- Loading branch information
1 parent
954eb95
commit b385099
Showing
6 changed files
with
266 additions
and
2 deletions.
There are no files selected for viewing
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,174 @@ | ||
|
||
dragon_knight.png | ||
size: 512, 512 | ||
format: RGBA8888 | ||
filter: Nearest, Nearest | ||
repeat: none | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 308, 105 | ||
size: 99, 99 | ||
orig: 99, 99 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 410, 207 | ||
size: 100, 99 | ||
orig: 100, 99 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 308, 4 | ||
size: 99, 99 | ||
orig: 99, 99 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 2, 308 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 206, 206 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_attack | ||
rotate: false | ||
xy: 2, 2 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 104, 308 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 308, 206 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 410, 410 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 2, 206 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 308, 308 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 206, 104 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 206, 308 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 2, 410 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 104, 2 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 2, 104 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 206, 2 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 308, 410 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_death | ||
rotate: false | ||
xy: 104, 410 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_run | ||
rotate: false | ||
xy: 104, 104 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_run | ||
rotate: false | ||
xy: 206, 410 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_run | ||
rotate: false | ||
xy: 410, 308 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
dragon_knight_run | ||
rotate: false | ||
xy: 104, 206 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 | ||
default | ||
rotate: false | ||
xy: 104, 206 | ||
size: 100, 100 | ||
orig: 100, 100 | ||
offset: 0, 0 | ||
index: -1 |
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
45 changes: 45 additions & 0 deletions
45
source/core/src/main/com/csse3200/game/components/npc/DragonKnightAnimationController.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,45 @@ | ||
package com.csse3200.game.components.npc; | ||
|
||
import com.badlogic.gdx.audio.Sound; | ||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.services.ServiceLocator; | ||
|
||
import java.util.Random; | ||
|
||
/** | ||
* This class listens to events relevant to a ghost entity's state and plays the animation when one | ||
* of the events is triggered. | ||
*/ | ||
public class DragonKnightAnimationController extends Component { | ||
// // For on collision sounds later | ||
// private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; | ||
// Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( | ||
// COLLISION_SFX, Sound.class); | ||
AnimationRenderComponent animator; | ||
Random rand = new Random(); | ||
|
||
@Override | ||
public void create() { | ||
super.create(); | ||
animator = this.entity.getComponent(AnimationRenderComponent.class); | ||
entity.getEvents().addListener("wanderStart", this::animateWalk); | ||
entity.getEvents().addListener("shootStart", this::animateAttack); | ||
entity.getEvents().addListener("dieStart", this::animateDeath); | ||
} | ||
|
||
void animateWalk() { | ||
animator.startAnimation("dragon_knight_run"); | ||
} | ||
|
||
void animateAttack() { | ||
animator.startAnimation("dragon_knight_attack"); | ||
} | ||
|
||
void animateDeath() { | ||
animator.startAnimation("dragon_knight_death"); | ||
} | ||
|
||
|
||
} | ||
|
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