Skip to content

Commit

Permalink
Merge branch 'Team-1--Mobs-Enhancement' into Isaac-Mob-Animation
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniSoda17 committed Sep 19, 2023
2 parents b385099 + fbaf223 commit 84cbe17
Show file tree
Hide file tree
Showing 8 changed files with 872 additions and 53 deletions.
523 changes: 523 additions & 0 deletions source/core/assets/images/mobboss/demon.atlas

Large diffs are not rendered by default.

Binary file added source/core/assets/images/mobboss/demon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/core/assets/images/mobboss/demon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 29 additions & 20 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ public class ForestGameArea extends GameArea {
"images/projectiles/firework_anim.png",
"images/projectiles/pierce_anim.png",
"images/projectiles/snow_ball.png",
"images/mobboss/demon.png",
"images/mobboss/demon2.png",
"images/mobs/fire_worm.png"
};
private static final String[] forestTextureAtlases = {
Expand Down Expand Up @@ -138,6 +140,7 @@ public class ForestGameArea extends GameArea {
"images/projectiles/firework_anim.atlas",
"images/projectiles/mobProjectile.atlas",
"images/projectiles/stun_effect.atlas",
"images/mobboss/demon.atlas",
"images/mobs/fire_worm.atlas",
"images/mobs/dragon_knight.atlas"
};
Expand Down Expand Up @@ -231,30 +234,32 @@ public void create() {
player = spawnPlayer();
player.getEvents().addListener("spawnWave", this::spawnFireWorm);

playMusic();
//playMusic();

// Types of projectile
// spawnAoeProjectile(new Vector2(0, 10), player, towardsMobs, new Vector2(2f, 2f), 1);
spawnProjectile(new Vector2(0, 10), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
spawnMultiProjectile(new Vector2(0, 10), PhysicsLayer.NPC, towardsMobs, 20, new Vector2(2f, 2f), 7);
spawnEffectProjectile(new Vector2(0, 10), PhysicsLayer.HUMANS, towardsMobs, new Vector2(2f, 2f), ProjectileEffects.BURN, true);
spawnPierceFireBall(new Vector2(2, 3), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
spawnRicochetFireball(new Vector2(2, 4), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
spawnSplitFireWorksFireBall(new Vector2(2, 5), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f), 12);
spawnEffectProjectile(new Vector2(2, 6), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f), ProjectileEffects.SLOW, false);
// spawnXenoGrunts();
// spawnFireWorm();
spawnWeaponTower();
//mobBoss1 = spawnMobBoss1();
startWaveTimer();
// spawnIncome();
spawnScrap();
spawnTNTTower();

spawnGapScanners();
spawnDroidTower();
// spawnProjectile(new Vector2(0, 10), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
// spawnMultiProjectile(new Vector2(0, 10), PhysicsLayer.NPC, towardsMobs, 20, new Vector2(2f, 2f), 7);
// spawnEffectProjectile(new Vector2(0, 10), PhysicsLayer.HUMANS, towardsMobs, new Vector2(2f, 2f), ProjectileEffects.BURN, true);
// spawnPierceFireBall(new Vector2(2, 3), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
// spawnRicochetFireball(new Vector2(2, 4), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f));
// spawnSplitFireWorksFireBall(new Vector2(2, 5), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f), 12);
// spawnEffectProjectile(new Vector2(2, 6), PhysicsLayer.NPC, towardsMobs, new Vector2(2f, 2f), ProjectileEffects.SLOW, false);
// spawnXenoGrunts();
// spawnWeaponTower();

spawnDemonBoss();

mobBoss2 = spawnMobBoss2();
//mobBoss1 = spawnMobBoss1();
// startWaveTimer();
//// spawnIncome();
// spawnScrap();
// spawnTNTTower();
//
// spawnGapScanners();
// spawnDroidTower();
//
// mobBoss2 = spawnMobBoss2();

}

Expand Down Expand Up @@ -389,6 +394,10 @@ private Entity spawnPlayer(GridPoint2 position) {
// return ghostKing;
// }

private void spawnDemonBoss() {
Entity demon = MobBossFactory.createDemonBoss();
spawnEntityAt(demon, new GridPoint2(19, 4), true, false);
}

private Entity spawnMobBoss1() {
int[] pickedLanes = new Random().ints(0, 8)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.csse3200.game.components.bosses;

import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;

public class DemonAnimationController extends Component {
AnimationRenderComponent animator;

/**
* Creation call for a TowerAnimationController, fetches the animationRenderComponent that this controller will
* be attached to and registers all the event listeners required to trigger the animations and sounds.
*/
@Override
public void create() {
super.create();
animator = entity.getComponent(AnimationRenderComponent.class);
registerAnimationListener("demon_walk");
registerAnimationListener("demon_cleave");
registerAnimationListener("demon_take_hit");
registerAnimationListener("demon_idle");
registerAnimationListener("demon_death");
registerAnimationListener("demon_cast_spell");
registerAnimationListener("demon_fire_breath");
registerAnimationListener("demon_smash");
registerAnimationListener("demon_take_hit");
registerAnimationListener("idle");
registerAnimationListener("move");
registerAnimationListener("projectile_explosion");
registerAnimationListener("projectile_idle");
registerAnimationListener("take_hit");
registerAnimationListener("transform");
}

private void registerAnimationListener(String animationName) {
entity.getEvents().addListener(animationName, () -> animator.startAnimation(animationName));
}


}

This file was deleted.

Loading

0 comments on commit 84cbe17

Please sign in to comment.