Skip to content

Commit

Permalink
Fixed some bugs on SonarCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasakev committed Oct 17, 2023
1 parent dee03f9 commit a02909b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,14 @@ private void dropCurrency() {
float randomValue = MathUtils.random(0f,1f);
logger.info("Random value: " + randomValue);
Entity currency;
if (randomValue <= CRYSTAL_DROP_RATE) {
currency = DropFactory.createCrystalDrop();
if (randomValue <= SCRAP_DROP_RATE && randomValue > CRYSTAL_DROP_RATE) {
currency = DropFactory.createScrapDrop();
currency.setPosition(mob.getPosition().x,mob.getPosition().y);
ServiceLocator.getEntityService().register(currency);

}
else if (randomValue <= SCRAP_DROP_RATE) {
currency = DropFactory.createScrapDrop();
} else if (randomValue <= CRYSTAL_DROP_RATE) {
currency = DropFactory.createCrystalDrop();
currency.setPosition(mob.getPosition().x,mob.getPosition().y);
ServiceLocator.getEntityService().register(currency);

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ private void addActors() {
TextButton pauseBtn = ButtonFactory.createButton("Back");

// Starting animation for pause button
pauseBtn.setPosition(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 150);
pauseBtn.addAction(new SequenceAction(Actions.moveTo(Gdx.graphics.getWidth() - 200,
Gdx.graphics.getHeight() - 150, 1f, Interpolation.fastSlow)));
pauseBtn.setPosition(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 150f);
pauseBtn.addAction(new SequenceAction(Actions.moveTo(Gdx.graphics.getWidth() - 200f,
Gdx.graphics.getHeight() - 150f, 1f, Interpolation.fastSlow)));

// Spawns a pause menu when the button is pressed.
pauseBtn.addListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public LoadingScreen(GdxGame game) {
stage = new Stage(new ScreenViewport());
Skin skin = new Skin(Gdx.files.internal("uiskin.json")); // Use your own skin file
loadingLabel = new Label("Loading", skin);
loadingLabel.setPosition(Gdx.graphics.getWidth() / 2 - 50, Gdx.graphics.getHeight() / 2);
loadingLabel.setPosition((float) Gdx.graphics.getWidth() / 2 - 50f, (float) Gdx.graphics.getHeight() / 2);
stage.addActor(loadingLabel);
}

Expand Down

0 comments on commit a02909b

Please sign in to comment.