Skip to content

Commit

Permalink
Added sound effects and fixed atk3 of ice baby
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyle1 committed Sep 28, 2023
1 parent 9cd130e commit e433d7f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
Binary file added source/core/assets/sounds/mobBoss/iceBabyAOE.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
33 changes: 18 additions & 15 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ public class ForestGameArea extends GameArea {
"sounds/engineers/firing_auto.mp3",
"sounds/engineers/firing_single.mp3",
"sounds/projectiles/on_collision.mp3",
"sounds/projectiles/explosion.mp3"
"sounds/projectiles/explosion.mp3",
"sounds/mobBoss/iceBabySound.mp3",
"sounds/mobBoss/mobSpawnStomp.mp3",
"sounds/mobBoss/iceBabyAOE.mp3"
};
private static final String backgroundMusic = "sounds/background/Sci-Fi1.ogg";
private static final String[] forestMusic = {backgroundMusic};
Expand Down Expand Up @@ -263,20 +266,20 @@ public void create() {
player = spawnPlayer();
logger.info("Lol");
spawnIceBaby();
player.getEvents().addListener("spawnWave", this::spawnWave);
playMusic();
startWaveTimer();
spawnScrap();
logger.info("Lol");
// spawnDeflectXenoGrunt(15, 5);
// spawnSplittingXenoGrunt(15, 4);
spawnScrap();
spawnTNTTower();
spawnWeaponTower();
logger.info("Lol");
spawnGapScanners();
spawnDroidTower();
logger.info("Lol");
// player.getEvents().addListener("spawnWave", this::spawnWave);
// playMusic();
// startWaveTimer();
// spawnScrap();
// logger.info("Lol");
// // spawnDeflectXenoGrunt(15, 5);
// // spawnSplittingXenoGrunt(15, 4);
// spawnScrap();
// spawnTNTTower();
// spawnWeaponTower();
// logger.info("Lol");
// spawnGapScanners();
// spawnDroidTower();
// logger.info("Lol");
}

private void displayUI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.services.ServiceLocator;

public class IceBabyAnimationController extends Component {
AnimationRenderComponent animator;
Expand All @@ -28,6 +30,17 @@ public class IceBabyAnimationController extends Component {
private static final String TAKEHIT = "startTake_hit";
private static final String WALK = "startWalk";

/** Sound variables */
private static final String SPAWN_SOUND = "sounds/mobBoss/iceBabySound.mp3";
Sound spawnSound = ServiceLocator.getResourceService().getAsset(
SPAWN_SOUND, Sound.class);
private static final String MOB_SPAWN_SOUND = "sounds/mobBoss/mobSpawnStomp.mp3";
Sound mobSpawnSound = ServiceLocator.getResourceService().getAsset(
MOB_SPAWN_SOUND, Sound.class);
private static final String AOE_SOUND = "sounds/mobBoss/iceBabyAOE.mp3";
Sound AOESound = ServiceLocator.getResourceService().getAsset(
AOE_SOUND, Sound.class);

@Override
public void create() {
super.create();
Expand All @@ -51,15 +64,22 @@ void animateATK1() {
}
void animateATK2() {
animator.startAnimation(ATK2_ANIM);
//volume does not work
mobSpawnSound.setVolume(1000, 5.5f);
mobSpawnSound.play();
}
void animateATK3() {
animator.startAnimation(ATK3_ANIM);
AOESound.setVolume(1000, 5.5f);
AOESound.play();
}
void animateDeath() {
animator.startAnimation(DEATH_ANIM);
}
void animateIntro() {
animator.startAnimation(INTRO_ANIM);
spawnSound.setVolume(1000, 5.5f);
spawnSound.play();
}
void animateTakeHit() {
animator.startAnimation(TAKEHIT_ANIM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public static Entity createIceBoss() {
ServiceLocator.getResourceService().getAsset("images/mobboss/iceBaby.atlas", TextureAtlas.class));
animator.addAnimation("idle", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("1_atk", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("2_atk", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("2_atk", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("2_atk", 0.1f, Animation.PlayMode.NORMAL);
animator.addAnimation("3_atk", 0.1f, Animation.PlayMode.NORMAL);
animator.addAnimation("death", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("intro_or_revive", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("intro_or_revive", 0.1f, Animation.PlayMode.NORMAL);
animator.addAnimation("stagger", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("take_hit", 0.2f, Animation.PlayMode.NORMAL);
animator.addAnimation("walk", 0.2f, Animation.PlayMode.NORMAL);
Expand Down

0 comments on commit e433d7f

Please sign in to comment.