diff --git a/source/core/assets/images/towers/fire_tower_atlas.atlas b/source/core/assets/images/towers/fire_tower_atlas.atlas index 80fa90a9f..7c9ce2206 100644 --- a/source/core/assets/images/towers/fire_tower_atlas.atlas +++ b/source/core/assets/images/towers/fire_tower_atlas.atlas @@ -1,83 +1,83 @@ fire_tower_atlas.png -size: 2048, 256 +size: 1024, 64 format: RGBA8888 filter: Nearest, Nearest repeat: none -attac_prep - rotate: false - xy: 2, 2 - size: 159, 150 - orig: 159, 150 - offset: 0, 0 - index: 2 attack rotate: false - xy: 467, 2 - size: 150, 150 - orig: 150, 150 + xy: 122, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 1 attack rotate: false - xy: 923, 2 - size: 150, 150 - orig: 150, 150 + xy: 302, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 3 attack rotate: false - xy: 1075, 2 - size: 150, 150 - orig: 150, 150 + xy: 422, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 0 attack rotate: false - xy: 1379, 2 - size: 150, 150 - orig: 150, 150 + xy: 602, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 2 -attack_prep - rotate: false - xy: 315, 2 - size: 150, 150 - orig: 150, 150 - offset: 0, 0 - index: 0 idle rotate: false - xy: 163, 2 - size: 150, 150 - orig: 150, 150 - offset: 0, 0 - index: 1 -attack_prep - rotate: false - xy: 163, 2 - size: 150, 150 - orig: 150, 150 + xy: 62, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 1 idle rotate: false - xy: 619, 2 - size: 150, 150 - orig: 150, 150 + xy: 182, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 3 idle rotate: false - xy: 771, 2 - size: 150, 150 - orig: 150, 150 + xy: 362, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 0 idle rotate: false - xy: 1227, 2 - size: 150, 150 - orig: 150, 150 + xy: 542, 2 + size: 58, 58 + orig: 58, 58 + offset: 0, 0 + index: 2 +prep_attack + rotate: false + xy: 2, 2 + size: 58, 58 + orig: 58, 58 + offset: 0, 0 + index: 1 +prep_attack + rotate: false + xy: 242, 2 + size: 58, 58 + orig: 58, 58 + offset: 0, 0 + index: 0 +prep_attack + rotate: false + xy: 482, 2 + size: 58, 58 + orig: 58, 58 offset: 0, 0 index: 2 diff --git a/source/core/assets/images/towers/fire_tower_atlas.png b/source/core/assets/images/towers/fire_tower_atlas.png index cbdce58d1..a8c5cc3ee 100644 Binary files a/source/core/assets/images/towers/fire_tower_atlas.png and b/source/core/assets/images/towers/fire_tower_atlas.png differ diff --git a/source/core/assets/images/towers/stun_tower.atlas b/source/core/assets/images/towers/stun_tower.atlas index feeea736b..f0033a197 100644 --- a/source/core/assets/images/towers/stun_tower.atlas +++ b/source/core/assets/images/towers/stun_tower.atlas @@ -7,112 +7,112 @@ repeat: none attack rotate: false xy: 2, 2 - size: 65, 45 - orig: 65, 45 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 4 attack rotate: false - xy: 136, 2 - size: 65, 45 - orig: 65, 45 + xy: 116, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 9 attack rotate: false - xy: 203, 2 - size: 65, 45 - orig: 65, 45 + xy: 173, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 1 attack rotate: false - xy: 270, 2 - size: 65, 45 - orig: 65, 45 + xy: 230, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 6 attack rotate: false - xy: 404, 2 - size: 65, 45 - orig: 65, 45 + xy: 344, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 3 attack rotate: false - xy: 538, 2 - size: 65, 45 - orig: 65, 45 + xy: 458, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 8 attack rotate: false - xy: 672, 2 - size: 65, 45 - orig: 65, 45 + xy: 572, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 0 attack rotate: false - xy: 739, 2 - size: 65, 45 - orig: 65, 45 + xy: 629, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 5 attack rotate: false - xy: 873, 2 - size: 65, 45 - orig: 65, 45 + xy: 743, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 2 attack rotate: false - xy: 940, 2 - size: 65, 45 - orig: 65, 45 + xy: 800, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 7 idle rotate: false - xy: 69, 2 - size: 65, 45 - orig: 65, 45 + xy: 59, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 1 idle rotate: false - xy: 337, 2 - size: 65, 45 - orig: 65, 45 + xy: 287, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 3 idle rotate: false - xy: 471, 2 - size: 65, 45 - orig: 65, 45 + xy: 401, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 0 idle rotate: false - xy: 605, 2 - size: 65, 45 - orig: 65, 45 + xy: 515, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 index: 5 idle rotate: false - xy: 605, 2 - size: 65, 45 - orig: 65, 45 + xy: 686, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 - index: 4 + index: 2 idle rotate: false - xy: 806, 2 - size: 65, 45 - orig: 65, 45 + xy: 857, 2 + size: 55, 45 + orig: 55, 45 offset: 0, 0 - index: 2 + index: 4 diff --git a/source/core/assets/images/towers/stun_tower.png b/source/core/assets/images/towers/stun_tower.png index 0d5c0d4f6..025b35a4c 100644 Binary files a/source/core/assets/images/towers/stun_tower.png and b/source/core/assets/images/towers/stun_tower.png differ diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 9f5edad80..d6c24507d 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -17,6 +17,8 @@ import com.csse3200.game.components.gamearea.GameAreaDisplay; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + +import java.util.Random; import java.util.Timer; import java.util.TimerTask; @@ -394,15 +396,16 @@ private void spawnWeaponTower() { GridPoint2 maxPos = terrain.getMapBounds(0).sub(2, 2); for (int i = 0; i < NUM_WEAPON_TOWERS; i++) { - GridPoint2 randomPos = RandomUtils.random(minPos, maxPos); + GridPoint2 randomPos1 = RandomUtils.random(minPos, maxPos); + GridPoint2 randomPos2 = RandomUtils.random(minPos, maxPos); //Entity weaponTower = TowerFactory.createWeaponTower(); Entity wallTower = TowerFactory.createWallTower(); Entity fireTower = TowerFactory.createFireTower(); Entity stunTower = TowerFactory.createStunTower(); //spawnEntityAt(weaponTower, randomPos, true, true); - spawnEntityAt(fireTower, randomPos, true, true); - spawnEntityAt(stunTower, randomPos, true, true); - spawnEntityAt(wallTower, new GridPoint2(randomPos.x + 3, randomPos.y), true, true); + spawnEntityAt(fireTower, randomPos1, true, true); + spawnEntityAt(stunTower, randomPos2, true, true); + //spawnEntityAt(wallTower, new GridPoint2(randomPos1.x + 3, randomPos1.y), true, true); } } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java index d2c2361f9..560790ce8 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java @@ -95,8 +95,8 @@ public void updateTowerState() { owner.getEntity().getEvents().trigger(ATTACK); Entity newProjectile = ProjectileFactory.createFireBall(owner.getEntity(), new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f, 2f)); - newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), - (float) (owner.getEntity().getPosition().y + 0.75)); + newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.25), + (float) (owner.getEntity().getPosition().y + 0.25)); ServiceLocator.getEntityService().register(newProjectile); } } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java index 1c2cc5863..830add348 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java @@ -78,8 +78,8 @@ public void updateTowerState() { owner.getEntity().getEvents().trigger(ATTACK); Entity newProjectile = ProjectileFactory.createFireBall(owner.getEntity(), new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f, 2f)); - newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), - (float) (owner.getEntity().getPosition().y + 0.75)); + newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.25), + (float) (owner.getEntity().getPosition().y + 0.25)); ServiceLocator.getEntityService().register(newProjectile); } } diff --git a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java index 90edc11af..534596767 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java @@ -16,6 +16,7 @@ import com.csse3200.game.components.tasks.CurrencyTask; import com.csse3200.game.entities.Entity; import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.PhysicsUtils; import com.csse3200.game.physics.components.ColliderComponent; import com.csse3200.game.physics.components.HitboxComponent; import com.csse3200.game.physics.components.PhysicsComponent; @@ -155,8 +156,7 @@ public static Entity createFireTower() { .addComponent(aiTaskComponent) .addComponent(animator) .addComponent(new FireTowerAnimationController()); - - fireTower.setScale(3, 3); + fireTower.setScale(1.25f, 1.25f); return fireTower; } @@ -182,6 +182,7 @@ public static Entity createStunTower() { .addComponent(new StunTowerAnimationController()); stunTower.setScale(1.5f, 1.5f); + PhysicsUtils.setScaledCollider(stunTower, 0.5f, 0.5f); return stunTower; }