Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging main into Engineers Branch #102

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed source/core/assets/sounds/BGM_03_mp3.mp3
Binary file not shown.
Binary file removed source/core/assets/sounds/Sci-Fi 1.ogg
Binary file not shown.
65 changes: 34 additions & 31 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public class ForestGameArea extends GameArea {

// Required to load assets before using them
private static final String[] forestTextures = {
"images/projectile.png",
"images/projectiles/projectile.png",
"images/box_boy_leaf.png",
"images/building1.png",
"images/background/building1.png",
"images/ghost_1.png",
"images/grass_2.png",
"images/grass_3.png",
"images/hex_grass_1.png",
"images/mountain.png",
"images/background/mountain.png",
"images/ghost_king.png",
"images/ghost_1.png",
"images/terrain 2 normal.png",
Expand All @@ -65,41 +65,44 @@ public class ForestGameArea extends GameArea {
"images/iso_grass_1.png",
"images/iso_grass_2.png",
"images/iso_grass_3.png",
"images/turret.png",
"images/turret01.png",
"images/turret_deployed.png",
"images/building2.png",
"images/wall.png",
"images/robot.png",
"images/Attack_1.png",
"images/Attack_2.png",
"images/Charge_1.png",
"images/Charge_2.png",
"images/Dead.png",
"images/Enabling-5.png",
"images/satyr.png",
"images/Hurt.png",
"images/Idle.png",
"images/rangeBossRight.png",
"images/wallTower.png",
"images/building2.png",
"images/towers/turret.png",
"images/towers/turret01.png",
"images/towers/turret_deployed.png",
"images/background/building2.png",
"images/mobs/robot.png",
"images/mobs/Attack_1.png",
"images/mobs/Attack_2.png",
"images/mobs/Charge_1.png",
"images/mobs/Charge_2.png",
"images/mobs/Dead.png",
"images/mobs/Enabling-5.png",
"images/mobs/satyr.png",
"images/mobs/Hurt.png",
"images/mobs/Idle.png",
"images/mobs/rangeBossRight.png",
"images/towers/wallTower.png",
"images/background/building2.png",
"images/iso_grass_3.png",
"images/scrap.png",
"images/mine_tower.png"
"images/economy/scrap.png",
"images/towers/mine_tower.png"
};
private static final String[] forestTextureAtlases = {
"images/terrain_iso_grass.atlas", "images/ghost.atlas", "images/ghostKing.atlas", "images/turret.atlas",
"images/turret01.atlas", "images/xenoGruntRunning.atlas",
"images/robot.atlas",
"images/rangeBossRight.atlas"
"images/terrain_iso_grass.atlas",
"images/ghost.atlas",
"images/ghostKing.atlas",
"images/towers/turret.atlas",
"images/towers/turret01.atlas",
"images/mobs/xenoGruntRunning.atlas",
"images/mobs/robot.atlas",
"images/mobs/rangeBossRight.atlas"
};
private static final String[] forestSounds = {
"sounds/Impact4.ogg",
"sounds/gun_shot_trimmed.mp3",
"sounds/deploy.mp3",
"sounds/stow.mp3"
"sounds/towers/gun_shot_trimmed.mp3",
"sounds/towers/deploy.mp3",
"sounds/towers/stow.mp3"
};
private static final String backgroundMusic = "sounds/Sci-Fi1.ogg";
private static final String backgroundMusic = "sounds/background/Sci-Fi1.ogg";
private static final String[] forestMusic = {backgroundMusic};

private final TerrainFactory terrainFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void addActors() {
table.padTop(50f).padLeft(20f);

// create text button style
Drawable drawable = new TextureRegionDrawable(new TextureRegion(new Texture("images/scrapsUI.png")));
Drawable drawable = new TextureRegionDrawable(new TextureRegion(new Texture("images/economy/scrapsUI.png")));
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(
drawable, drawable, drawable, new BitmapFont());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void addActors() {
Image title =
new Image(
ServiceLocator.getResourceService()
.getAsset("images/Logo2.png", Texture.class));
.getAsset("images/ui/Logo2.png", Texture.class));

TextButton startBtn = new TextButton("Start", skin);
TextButton loadBtn = new TextButton("Help", skin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void addActors() {

// Heart image
float bossSideLength = 30f;
bossImage = new Image(ServiceLocator.getResourceService().getAsset("images/boss_health.png", Texture.class));
bossImage = new Image(ServiceLocator.getResourceService().getAsset("images/mobs/boss_health.png", Texture.class));

// Health text
int health = entity.getComponent(CombatStatsComponent.class).getHealth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class TowerAnimationController extends Component {
private static final String FIRE_ANIM = "firing";
private static final String STOW_ANIM = "stow";
// Sound effects constants
private static final String DEPLOY_SFX = "sounds/deploy.mp3";
private static final String FIRE_SFX = "sounds/gun_shot_trimmed.mp3";
private static final String STOW_SFX = "sounds/stow.mp3";
private static final String DEPLOY_SFX = "sounds/towers/deploy.mp3";
private static final String FIRE_SFX = "sounds/towers/gun_shot_trimmed.mp3";
private static final String STOW_SFX = "sounds/towers/stow.mp3";

AnimationRenderComponent animator;
Sound deploySound = ServiceLocator.getResourceService().getAsset(
Expand All @@ -33,6 +33,10 @@ public class TowerAnimationController extends Component {
Sound stowSound = ServiceLocator.getResourceService().getAsset(
STOW_SFX, Sound.class);

/**
* 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();
Expand All @@ -43,6 +47,9 @@ public void create() {
entity.getEvents().addListener(FIRING, this::animateFiring);
}

/**
* Starts the
*/
void animateIdle() {
animator.startAnimation(IDLE_ANIM);
}
Expand Down
2 changes: 1 addition & 1 deletion source/core/src/main/com/csse3200/game/currency/Scrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class Scrap extends Currency {

private static final int STARTING_CURRENCY = 100;

private static final String LOGO_FILE_PATH = "images/scrap.png"; // The file path of the logo
private static final String LOGO_FILE_PATH = "images/economy/scrap.png"; // The file path of the logo

/**
* Constructor for the scrap currency object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static Entity createBossKing1(Entity target) {
AnimationRenderComponent animator1 =
new AnimationRenderComponent(
ServiceLocator.getResourceService()
.getAsset("images/rangeBossRight.atlas", TextureAtlas.class));
.getAsset("images/mobs/rangeBossRight.atlas", TextureAtlas.class));
animator1.addAnimation("Walk", 0.3f, Animation.PlayMode.LOOP);


Expand Down Expand Up @@ -78,7 +78,7 @@ public static Entity createBossKing2(Entity target) {
AnimationRenderComponent animator2 =
new AnimationRenderComponent(
ServiceLocator.getResourceService()
.getAsset("images/robot.atlas", TextureAtlas.class));
.getAsset("images/mobs/robot.atlas", TextureAtlas.class));
animator2.addAnimation("Walk", 0.3f, Animation.PlayMode.LOOP);

bossKing2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static Entity createGhost(Entity target) {
ghost
.addComponent(new CombatStatsComponent(config.health, config.baseAttack))
// .addComponent(animator)
.addComponent(new TextureRenderComponent("images/satyr.png"));
.addComponent(new TextureRenderComponent("images/mobs/satyr.png"));
// .addComponent(new GhostAnimationController());

ghost.getComponent(TextureRenderComponent.class).scaleEntity();
Expand Down Expand Up @@ -111,7 +111,7 @@ public static Entity createXenoGrunt(Entity target) {

AnimationRenderComponent animator =
new AnimationRenderComponent(
ServiceLocator.getResourceService().getAsset("images/xenoGruntRunning.atlas", TextureAtlas.class));
ServiceLocator.getResourceService().getAsset("images/mobs/xenoGruntRunning.atlas", TextureAtlas.class));
animator.addAnimation("xeno_run", 0.1f, Animation.PlayMode.LOOP);
animator.addAnimation("xeno_shoot", 0.1f, Animation.PlayMode.NORMAL);
animator.addAnimation("xeno_melee", 0.1f, Animation.PlayMode.NORMAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ObstacleFactory {
public static Entity createBuilding1() {
Entity building1 =
new Entity()
.addComponent(new TextureRenderComponent("images/building1.png"))
.addComponent(new TextureRenderComponent("images/background/building1.png"))
.addComponent(new PhysicsComponent())
.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));

Expand All @@ -35,7 +35,7 @@ public static Entity createBuilding1() {
public static Entity createBuilding2() {
Entity building2 =
new Entity()
.addComponent(new TextureRenderComponent("images/building2.png"))
.addComponent(new TextureRenderComponent("images/background/building2.png"))
.addComponent(new PhysicsComponent())
.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));

Expand All @@ -49,7 +49,7 @@ public static Entity createBuilding2() {
public static Entity createMountain() {
Entity mountain =
new Entity()
.addComponent(new TextureRenderComponent("images/mountain.png"))
.addComponent(new TextureRenderComponent("images/background/mountain.png"))
.addComponent(new PhysicsComponent())
.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class ProjectileFactory {

private static final NPCConfigs configs =
FileLoader.readClass(NPCConfigs.class, "configs/NPCS.json");
FileLoader.readClass(NPCConfigs.class, "configs/NPCs.json");

/**
* Creates a fireball Entity.
Expand All @@ -40,7 +40,7 @@ public static Entity createFireBall(Entity target, Vector2 destination, Vector2
Entity projectile = createBaseProjectile(target, destination);

projectile
.addComponent(new TextureRenderComponent("images/projectile.png"))
.addComponent(new TextureRenderComponent("images/projectiles/projectile.png"))
.addComponent(new ColliderComponent().setSensor(true))

// This is the component that allows the projectile to damage a specified target.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class TowerFactory {

private static final int COMBAT_TASK_PRIORITY = 2;
private static final int WEAPON_TOWER_MAX_RANGE = 40;
private static final String WALL_IMAGE = "images/wallTower.png";
private static final String TURRET_ATLAS = "images/turret01.atlas";
private static final String WALL_IMAGE = "images/towers/wallTower.png";
private static final String TURRET_ATLAS = "images/towers/turret01.atlas";
private static final String IDLE_ANIM = "idle";
private static final float IDLE_SPEED = 0.3f;
private static final String DEPLOY_ANIM = "deploy";
Expand Down Expand Up @@ -69,7 +69,7 @@ public static Entity createIncomeTower() {
income
.addComponent(new CombatStatsComponent(config.health, config.baseAttack))
.addComponent(new CostComponent(config.cost))
.addComponent(new TextureRenderComponent("images/mine_tower.png"))
.addComponent(new TextureRenderComponent("images/towers/mine_tower.png"))
.addComponent(aiTaskComponent);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void loadAssets() {
logger.debug("Loading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
resourceService.loadTextures(mainGameTextures);
backgroundTexture = new Texture("images/background1.png"); // Load the background image
backgroundTexture = new Texture("images/background/background1.png"); // Load the background image
ServiceLocator.getResourceService().loadAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MainMenuScreen extends ScreenAdapter {
private final Renderer renderer;
private Texture backgroundTexture;
private final SpriteBatch batch;
private static final String[] mainMenuTextures = {"images/Logo2.png"};
private static final String[] mainMenuTextures = {"images/ui/Logo2.png"};

public MainMenuScreen(GdxGame game) {
this.game = game;
Expand Down Expand Up @@ -97,7 +97,7 @@ private void loadAssets() {
logger.debug("Loading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
resourceService.loadTextures(mainMenuTextures);
backgroundTexture = new Texture("images/background1.png"); // Load the background image
backgroundTexture = new Texture("images/background/background1.png"); // Load the background image
ServiceLocator.getResourceService().loadAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@ExtendWith(GameExtension.class)
class CurrencyTest {
private Entity scrap;
private String[] texture = {"images/scrap.png"};
private String[] texture = {"images/economy/scrap.png"};

@BeforeEach
public void setUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@ExtendWith(GameExtension.class)
class ProjectileFactoryTest {
private String[] texture = {"images/projectile.png"};
private String[] texture = {"images/projectiles/projectile.png"};
private Entity projectile;

@BeforeEach
Expand All @@ -47,7 +47,7 @@ public void setUp() {
resourceService.loadTextures(texture);
resourceService.loadAll();
ServiceLocator.getResourceService()
.getAsset("images/projectile.png", Texture.class);
.getAsset("images/projectiles/projectile.png", Texture.class);
Vector2 destination = new Vector2(0.1f, 0.1f);
Vector2 speed = new Vector2(0.2f, 0.2f);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public class TowerFactoryTest {
private Entity weaponTower;
private Entity wallTower;
private String[] texture = {
"images/turret_deployed.png",
"images/turret01.png",
"images/wallTower.png"
"images/towers/turret_deployed.png",
"images/towers/turret01.png",
"images/towers/wallTower.png"
};
private String[] atlas = {"images/turret01.atlas"};
private String[] atlas = {"images/towers/turret01.atlas"};
private static final String[] sounds = {
"sounds/gun_shot_trimmed.mp3",
"sounds/deploy.mp3",
"sounds/stow.mp3"
"sounds/towers/gun_shot_trimmed.mp3",
"sounds/towers/deploy.mp3",
"sounds/towers/stow.mp3"
};

@BeforeEach
Expand All @@ -67,7 +67,7 @@ public void setUp() {
resourceService.loadSounds(sounds);
resourceService.loadAll();
ServiceLocator.getResourceService()
.getAsset("images/turret01.atlas", TextureAtlas.class);
.getAsset("images/towers/turret01.atlas", TextureAtlas.class);
baseTower = TowerFactory.createBaseTower();
weaponTower = TowerFactory.createWeaponTower();
wallTower = TowerFactory.createWallTower();
Expand Down
Loading