Skip to content

Commit

Permalink
gave box boy some features for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gregchan550 committed Sep 21, 2023
1 parent a2a48ff commit 66b642d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.*;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.HitboxComponent;
import com.csse3200.game.utils.math.RandomUtils;
import com.csse3200.game.services.ResourceService;
import com.csse3200.game.services.ServiceLocator;
Expand Down Expand Up @@ -38,7 +39,7 @@ public class ForestGameArea extends GameArea {
private Timer bossSpawnTimer;
private int bossSpawnInterval = 10000; // 1 minute in milliseconds
private static final int NUM_WEAPON_TOWERS = 3;
private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(0, 0);
private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(2, 4);
// Temporary spawn point for testing
private static final float WALL_WIDTH = 0.1f;

Expand Down Expand Up @@ -235,7 +236,7 @@ public void create() {

// Set up infrastructure for end game tracking
player = spawnPlayer();
//player.getEvents().addListener("spawnWave", this::spawnWave);
player.getEvents().addListener("spawnWave", this::spawnWave);

//playMusic();

Expand All @@ -251,8 +252,8 @@ public void create() {
// spawnXenoGrunts();
// spawnWeaponTower();

// spawnDragonKnight();
// spawnFireWorm();
spawnDragonKnight();
spawnFireWorm();
spawnDemonBoss();

//mobBoss1 = spawnMobBoss1();
Expand Down Expand Up @@ -360,12 +361,12 @@ private void spawnBuilding2() {
spawnEntityAt(building2, randomPos, true, false);
}
}



private Entity spawnPlayer() {
Entity newPlayer = PlayerFactory.createPlayer();
spawnEntityAt(newPlayer, PLAYER_SPAWN, true, true);
newPlayer.addComponent(new TouchAttackComponent(PhysicsLayer.NPC));
newPlayer.addComponent(new HitboxComponent().setLayer(PhysicsLayer.HUMANS));
return newPlayer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static Entity createPlayer() {
.addComponent(new ColliderComponent())
.addComponent(new HitboxComponent().setLayer(PhysicsLayer.ENGINEER))
.addComponent(new PlayerActions())
.addComponent(new CombatStatsComponent(stats.health, stats.baseAttack))
.addComponent(new CombatStatsComponent(1000, 5000))
.addComponent(new InventoryComponent(stats.gold))
.addComponent(inputComponent)
.addComponent(aiComponent)
Expand Down

0 comments on commit 66b642d

Please sign in to comment.