Skip to content

Commit

Permalink
Merge pull request #103 from UQcsse3200/Team-2-engineers-ahmad
Browse files Browse the repository at this point in the history
Team 2 engineers ahmad
  • Loading branch information
The-AhmadAA authored Sep 6, 2023
2 parents 7e15eab + 354b55f commit 994758f
Show file tree
Hide file tree
Showing 16 changed files with 806 additions and 20 deletions.
6 changes: 6 additions & 0 deletions source/core/assets/configs/Engineers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"engineer" : {
"health": 100,
"baseAttack": 5
}
}
272 changes: 272 additions & 0 deletions source/core/assets/images/engineers/engineer.atlas
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@

engineer.png
size: 512, 256
format: RGBA8888
filter: Nearest, Nearest
repeat: none
firing
rotate: false
xy: 25, 190
size: 52, 31
orig: 52, 31
offset: 0, 0
index: 2
firing
rotate: false
xy: 25, 154
size: 52, 31
orig: 52, 31
offset: 0, 0
index: 4
firing
rotate: false
xy: 102, 190
size: 52, 31
orig: 52, 31
offset: 0, 0
index: 1
firing
rotate: false
xy: 25, 118
size: 52, 31
orig: 52, 31
offset: 0, 0
index: 3
death
rotate: false
xy: 25, 81
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 6
death
rotate: false
xy: 350, 189
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
death
rotate: false
xy: 330, 152
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 5
death
rotate: false
xy: 82, 79
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
death
rotate: false
xy: 253, 78
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 4
death
rotate: false
xy: 367, 41
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
hit
rotate: false
xy: 25, 7
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
hit
rotate: false
xy: 159, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
hit
rotate: false
xy: 253, 41
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
idle_left
rotate: false
xy: 179, 189
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
idle_left
rotate: false
xy: 216, 152
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 4
idle_left
rotate: false
xy: 216, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
idle_left
rotate: false
xy: 139, 41
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
idle_right
rotate: false
xy: 159, 152
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
idle_right
rotate: false
xy: 273, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 4
idle_right
rotate: false
xy: 82, 5
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
idle_right
rotate: false
xy: 310, 78
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
default
rotate: false
xy: 216, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
walk_left
rotate: false
xy: 102, 153
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 6
walk_left
rotate: false
xy: 293, 189
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
walk_left
rotate: false
xy: 407, 189
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 8
walk_left
rotate: false
xy: 273, 152
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 5
walk_left
rotate: false
xy: 387, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
walk_left
rotate: false
xy: 82, 42
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 7
walk_left
rotate: false
xy: 196, 78
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 4
walk_left
rotate: false
xy: 367, 78
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
walk_right
rotate: false
xy: 25, 44
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 2
walk_right
rotate: false
xy: 236, 189
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 7
walk_right
rotate: false
xy: 102, 116
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 4
walk_right
rotate: false
xy: 387, 152
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 1
walk_right
rotate: false
xy: 330, 115
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 6
walk_right
rotate: false
xy: 139, 78
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 3
walk_right
rotate: false
xy: 196, 41
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 8
walk_right
rotate: false
xy: 310, 41
size: 52, 31
orig: 32, 32
offset: 0, 0
index: 5
Binary file added source/core/assets/images/engineers/engineer.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 not shown.
Binary file not shown.
12 changes: 8 additions & 4 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.badlogic.gdx.math.GridPoint2;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.csse3200.game.components.CombatStatsComponent;
import com.csse3200.game.input.DropInputComponent;
import com.csse3200.game.areas.terrain.TerrainFactory;
import com.csse3200.game.areas.terrain.TerrainFactory.TerrainType;
Expand Down Expand Up @@ -100,7 +101,8 @@ public class ForestGameArea extends GameArea {
"sounds/Impact4.ogg",
"sounds/towers/gun_shot_trimmed.mp3",
"sounds/towers/deploy.mp3",
"sounds/towers/stow.mp3"
"sounds/towers/stow.mp3",
"sounds/engineers/firing_auto.mp3"
};
private static final String backgroundMusic = "sounds/background/Sci-Fi1.ogg";
private static final String[] forestMusic = {backgroundMusic};
Expand Down Expand Up @@ -134,9 +136,9 @@ public void create() {
displayUI();

spawnTerrain();
spawnBuilding1();
spawnBuilding2();
spawnMountains();
// spawnBuilding1();
// spawnBuilding2();
// spawnMountains();
player = spawnPlayer();

playMusic();
Expand All @@ -154,6 +156,8 @@ public void create() {

bossKing1 = spawnBossKing1();
bossKing2 = spawnBossKing2();
Entity engineer = EngineerFactory.createEngineer(player);
spawnEntityAt(engineer, new GridPoint2(5, 20), true, true);

playMusic();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,18 @@ public void setBaseAttack(int attack) {
public void hit(Integer damage) {
int newHealth = getHealth() - damage;
setHealth(newHealth);
if (entity != null && !this.isDead()) {
entity.getEvents().trigger("hitStart");
}
changeState();
}

// Default CombatStatsComponent that relies on the attacker's combatStatsComponent.
public void hit(CombatStatsComponent attacker) {
int newHealth = getHealth() - attacker.getBaseAttack();
if (entity != null && !this.isDead()) {
entity.getEvents().trigger("hitStart");
}
setHealth(newHealth);
}

Expand Down
Loading

0 comments on commit 994758f

Please sign in to comment.