Skip to content

Commit

Permalink
code smell cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
The-AhmadAA committed Oct 15, 2023
1 parent 126d427 commit 3406eab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public class TowerCombatTask extends DefaultTask implements PriorityTask {
private final float maxRange;
private Vector2 towerPosition = new Vector2(10, 10); // initial placeholder value - will be overwritten
private final Vector2 maxRangePosition = new Vector2();
private PhysicsEngine physics;
private GameTime timeSource;
private final PhysicsEngine physics;
private final GameTime timeSource;
private long endTime;
private final RaycastHit hit = new RaycastHit();
private static final Logger logger = LoggerFactory.getLogger(ForestGameArea.class);
private static final Logger logger = LoggerFactory.getLogger(TowerCombatTask.class);
private boolean shoot = true;

private enum STATE {
Expand Down Expand Up @@ -154,26 +154,8 @@ public void updateTowerState() {

Entity newProjectile = ProjectileFactory.createFireBall(PhysicsLayer.NPC, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f, 2f));
newProjectile.setScale(1.1f, 0.8f);
newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.5), (float) (owner.getEntity().getPosition().y));
newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.5), (owner.getEntity().getPosition().y));
ServiceLocator.getEntityService().register(newProjectile);

// * TEMPRORARYYYYYYYY PLS DON'T DELETE THIS
// PIERCE FIREBALL
// Entity pierceFireball = ProjectileFactory.createPierceFireBall(PhysicsLayer.NPC, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f));
// pierceFireball.setPosition((float) (owner.getEntity().getPosition().x + 0), (float) (owner.getEntity().getPosition().y + 0.4));
// ServiceLocator.getEntityService().register(pierceFireball);

// RICOCHET FIREBALL
// Entity ricochetProjectile = ProjectileFactory.createRicochetFireball(PhysicsLayer.NPC, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f), 0);

// ricochetProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0), (float) (owner.getEntity().getPosition().y + 0.4));
// ServiceLocator.getEntityService().register(ricochetProjectile);

// SPLIT FIREWORKS FIREBALLL
// Entity splitFireWorksProjectile = ProjectileFactory.createSplitFireWorksFireball(PhysicsLayer.NPC, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f), 16);

// splitFireWorksProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), (float) (owner.getEntity().getPosition().y + 0.4));
// ServiceLocator.getEntityService().register(splitFireWorksProjectile);
}
}
shoot = !shoot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.csse3200.game.GdxGame;
import com.csse3200.game.areas.ForestGameArea;
import com.csse3200.game.components.gamearea.PerformanceDisplay;
Expand Down Expand Up @@ -85,7 +84,7 @@ public class MainGameScreen extends ScreenAdapter {
private final Renderer renderer;
private final PhysicsEngine physicsEngine;
private final InputComponent buildHandler;
private InputComponent upgradedInputHandler;
private final InputComponent upgradedInputHandler;
static int screenWidth = Gdx.graphics.getWidth();
static int screenHeight = Gdx.graphics.getHeight();
private Entity ui;
Expand All @@ -108,8 +107,6 @@ public MainGameScreen(GdxGame game) {

batch = new SpriteBatch();

Stage stage = new Stage(new ScreenViewport());

logger.debug("Initialising main game screen services");
ServiceLocator.registerTimeSource(new GameTime());

Expand Down

0 comments on commit 3406eab

Please sign in to comment.