-
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.
- Loading branch information
1 parent
714b446
commit 23d5db0
Showing
9 changed files
with
103 additions
and
5 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
source/core/assets/images/projectiles/engineer_projectile.atlas
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,41 @@ | ||
|
||
engineer_projectile.png | ||
size: 128, 32 | ||
format: RGBA8888 | ||
filter: Nearest, Nearest | ||
repeat: none | ||
bullet | ||
rotate: false | ||
xy: 68, 2 | ||
size: 19, 19 | ||
orig: 19, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
bullet | ||
rotate: false | ||
xy: 25, 2 | ||
size: 20, 19 | ||
orig: 20, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
default | ||
rotate: false | ||
xy: 25, 2 | ||
size: 20, 19 | ||
orig: 20, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
bullet | ||
rotate: false | ||
xy: 2, 2 | ||
size: 21, 19 | ||
orig: 21, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
bulletFinal | ||
rotate: false | ||
xy: 47, 2 | ||
size: 19, 19 | ||
orig: 19, 19 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ rotate | |
index: -1 | ||
default | ||
rotate: false | ||
xy: 54, 2 | ||
xy: 28, 2 | ||
size: 24, 23 | ||
orig: 24, 23 | ||
offset: 0, 0 | ||
|
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
29 changes: 29 additions & 0 deletions
29
source/core/src/main/com/csse3200/game/components/projectile/EngineerBullets.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,29 @@ | ||
package com.csse3200.game.components.projectile; | ||
|
||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.services.ServiceLocator; //used for sound | ||
|
||
public class EngineerBullets extends Component{ | ||
/** Event name constants */ | ||
|
||
AnimationRenderComponent animator; | ||
|
||
@Override | ||
public void create() { | ||
super.create(); | ||
animator = this.entity.getComponent(AnimationRenderComponent.class); | ||
entity.getEvents().addListener("start", this::animateStart); | ||
entity.getEvents().addListener("final", this::animateFinal); | ||
|
||
} | ||
|
||
void animateStart() { | ||
animator.startAnimation("bullet"); | ||
} | ||
|
||
void animateFinal() { | ||
animator.startAnimation("bulletFinal"); | ||
} | ||
} | ||
|
3 changes: 2 additions & 1 deletion
3
...nts/MobProjectileAnimationController.java → ...ile/MobProjectileAnimationController.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
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
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