-
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 atlas file and animations for basic projectile
- Loading branch information
Showing
10 changed files
with
140 additions
and
8 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
source/core/assets/images/projectiles/basic_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,50 @@ | ||
|
||
basic_projectile.png | ||
size: 128, 32 | ||
format: RGBA8888 | ||
filter: Nearest, Nearest | ||
repeat: none | ||
projectileFinal5 | ||
rotate: false | ||
xy: 2, 17 | ||
size: 24, 13 | ||
orig: 24, 13 | ||
offset: 0, 0 | ||
index: 5 | ||
projectile4 | ||
rotate: false | ||
xy: 2, 2 | ||
size: 23, 13 | ||
orig: 23, 13 | ||
offset: 0, 0 | ||
index: 4 | ||
projectile3 | ||
rotate: false | ||
xy: 27, 2 | ||
size: 23, 13 | ||
orig: 23, 13 | ||
offset: 0, 0 | ||
index: 3 | ||
projectile2 | ||
rotate: false | ||
xy: 28, 17 | ||
size: 23, 13 | ||
orig: 23, 13 | ||
offset: 0, 0 | ||
index: 2 | ||
projectileStart1 | ||
rotate: false | ||
xy: 53, 16 | ||
size: 22, 14 | ||
orig: 22, 14 | ||
offset: 0, 0 | ||
index: 1 | ||
default | ||
rotate: false | ||
xy: 53, 16 | ||
size: 22, 14 | ||
orig: 22, 14 | ||
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.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
55 changes: 55 additions & 0 deletions
55
.../core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.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,55 @@ | ||
package com.csse3200.game.components.projectile; | ||
|
||
import com.csse3200.game.components.Component; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.services.ServiceLocator; | ||
|
||
public class ProjectileAnimationController extends Component{ | ||
/** Event name constants */ | ||
private static final String START = "startProjectileStart1"; | ||
private static final String PHASE1 = "startProjectile2"; | ||
private static final String PHASE2 = "startProjectile3"; | ||
private static final String PHASE3 = "startProjectile4"; | ||
private static final String FINAL = "startProjectileFinish5"; | ||
|
||
/** Animation name constants */ | ||
private static final String START_ANIM = "projectileStart1"; | ||
private static final String PHASE1_ANIM = "projectile2"; | ||
private static final String PHASE2_ANIM = "projectile3"; | ||
private static final String PHASE3_ANIM = "projectile4"; | ||
private static final String FINAL_ANIM = "projectileFinish5"; | ||
|
||
AnimationRenderComponent animator; | ||
|
||
@Override | ||
public void create() { | ||
super.create(); | ||
animator = this.entity.getComponent(AnimationRenderComponent.class); | ||
entity.getEvents().addListener(START, this::animateStart); | ||
entity.getEvents().addListener(START, this::animatePhase1); | ||
entity.getEvents().addListener(START, this::animatePhase2); | ||
entity.getEvents().addListener(START, this::animatePhase3); | ||
entity.getEvents().addListener(START, this::animateFinal); | ||
|
||
} | ||
|
||
void animateStart() { | ||
animator.startAnimation(START_ANIM); | ||
} | ||
|
||
void animatePhase1() { | ||
animator.startAnimation(PHASE1_ANIM); | ||
} | ||
|
||
void animatePhase2() { | ||
animator.startAnimation(PHASE2_ANIM); | ||
} | ||
|
||
void animatePhase3() { | ||
animator.startAnimation(PHASE3_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