Skip to content

Commit

Permalink
renamed tower1 to fireTower and tower2 with stunTower in relevant files
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv-0831 committed Sep 6, 2023
1 parent 71079ee commit 3ebc055
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions source/core/assets/configs/tower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"baseAttack": 0,
"cost": 1
},
"tower1": {
"fireTower": {
"health": 10,
"baseAttack": 10,
"cost": 10
},
"tower2": {
"stunTower": {
"health": 10,
"baseAttack": 10,
"cost": 10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.csse3200.game.entities.configs;

public class Tower1Config {
public class FireTowerConfig {
public int health = 1;
public int baseAttack = 0;
public int cost = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.csse3200.game.entities.configs;

public class Tower2Config {
public class StunTowerConfig {
public int health = 1;
public int baseAttack = 0;
public int cost = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public class baseTowerConfigs {
public WeaponTowerConfig weapon = new WeaponTowerConfig();
public WallTowerConfig wall = new WallTowerConfig();
public IncomeTowerConfig income = new IncomeTowerConfig();
public Tower1Config tower1 = new Tower1Config();
public Tower2Config tower2 = new Tower2Config();
public FireTowerConfig fireTower = new FireTowerConfig();
public StunTowerConfig stunTower = new StunTowerConfig();
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.csse3200.game.entities.factories;

import com.csse3200.game.entities.Weapon;
import com.csse3200.game.entities.configs.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
Expand Down Expand Up @@ -120,26 +116,25 @@ public static Entity createWeaponTower() {

}

public static Entity createWeaponTower1() {
Entity weaponTower = createBaseTower();
Tower1Config config = configs.tower1;

weaponTower
public static Entity createFireTower() {
Entity fireTower = createBaseTower();
FireTowerConfig config = configs.fireTower;
fireTower
.addComponent(new CombatStatsComponent(config.health, config.baseAttack))
.addComponent(new CostComponent(config.cost));

return weaponTower;
return fireTower;
}

public static Entity createWeaponTower2() {
Entity weaponTower = createBaseTower();
Tower2Config config = configs.tower2;
public static Entity createStunTower() {
Entity stunTower = createBaseTower();
StunTowerConfig config = configs.stunTower;

weaponTower
stunTower
.addComponent(new CombatStatsComponent(config.health, config.baseAttack))
.addComponent((new CostComponent(config.cost)));

return weaponTower;
return stunTower;
}

/**
Expand Down

0 comments on commit 3ebc055

Please sign in to comment.