-
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.
Merge branch 'Team-1--Projectiles' of https://github.com/UQcsse3200/2…
…023-studio-3 into collision-components-test
- Loading branch information
Showing
5 changed files
with
96 additions
and
4 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,42 @@ | ||
|
||
pierce_anim.png | ||
size: 256, 32 | ||
format: RGBA8888 | ||
filter: Nearest, Nearest | ||
repeat: none | ||
projectile | ||
rotate: false | ||
xy: 2, 2 | ||
size: 35, 26 | ||
orig: 35, 26 | ||
offset: 0, 0 | ||
index: -1 | ||
projectile | ||
rotate: false | ||
xy: 76, 2 | ||
size: 35, 26 | ||
orig: 35, 26 | ||
offset: 0, 0 | ||
index: -1 | ||
projectile | ||
rotate: false | ||
xy: 39, 2 | ||
size: 35, 26 | ||
orig: 35, 26 | ||
offset: 0, 0 | ||
index: -1 | ||
projectile | ||
rotate: false | ||
xy: 113, 2 | ||
size: 35, 26 | ||
orig: 35, 26 | ||
offset: 0, 0 | ||
index: -1 | ||
default | ||
projectile | ||
rotate: false | ||
xy: 2, 2 | ||
size: 35, 26 | ||
orig: 35, 26 | ||
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
25 changes: 25 additions & 0 deletions
25
...src/main/com/csse3200/game/components/projectile/PierceProjectileAnimationController.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,25 @@ | ||
package com.csse3200.game.components.projectile; | ||
|
||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
|
||
public class PierceProjectileAnimationController extends Component { | ||
/** Event name constants */ | ||
private static final String START = "startProjectile"; | ||
/** Animation name constants */ | ||
private static final String START_ANIM = "projectile"; | ||
AnimationRenderComponent animator; | ||
|
||
|
||
@Override | ||
public void create() { | ||
super.create(); | ||
animator = this.entity.getComponent(AnimationRenderComponent.class); | ||
entity.getEvents().addListener(START, this::animateStart); | ||
|
||
} | ||
|
||
void animateStart() { | ||
animator.startAnimation(START_ANIM); | ||
} | ||
} |
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