-
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.
Added snow ball design and animation to slow effect projectile
- Loading branch information
1 parent
6b0f06e
commit c23cab8
Showing
5 changed files
with
102 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,48 @@ | ||
|
||
snow_ball.png | ||
size: 128, 32 | ||
format: RGBA8888 | ||
filter: Nearest, Nearest | ||
repeat: none | ||
projectile | ||
rotate: false | ||
xy: 20, 2 | ||
size: 16, 19 | ||
orig: 16, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
projectile | ||
rotate: false | ||
xy: 56, 2 | ||
size: 16, 19 | ||
orig: 16, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
projectile | ||
rotate: false | ||
xy: 38, 2 | ||
size: 16, 19 | ||
orig: 16, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
projectileFinal | ||
rotate: false | ||
xy: 2, 2 | ||
size: 16, 19 | ||
orig: 16, 19 | ||
offset: 0, 0 | ||
index: -1 | ||
collision | ||
rotate: false | ||
xy: 92, 3 | ||
size: 16, 18 | ||
orig: 16, 18 | ||
offset: 0, 0 | ||
index: -1 | ||
collision | ||
rotate: false | ||
xy: 74, 3 | ||
size: 16, 18 | ||
orig: 16, 18 | ||
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
31 changes: 31 additions & 0 deletions
31
...c/main/com/csse3200/game/components/projectile/SnowBallProjectileAnimationController.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,31 @@ | ||
package com.csse3200.game.components.projectile; | ||
|
||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
|
||
public class SnowBallProjectileAnimationController extends Component{ | ||
private static final String START = "startProjectile"; | ||
private static final String FINAL = "startProjectileFinal"; | ||
|
||
/** Animation name constants */ | ||
private static final String START_ANIM = "projectile"; | ||
private static final String FINAL_ANIM = "projectileFinal"; | ||
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(START_ANIM); | ||
} | ||
|
||
void animateFinal() { | ||
animator.startAnimation(FINAL_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