Skip to content

Commit

Permalink
merge main into team-2-ahmad, skin fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
The-AhmadAA committed Oct 16, 2023
2 parents 91801fd + fd7c9ce commit 4cf94e6
Show file tree
Hide file tree
Showing 53 changed files with 948 additions and 659 deletions.
Binary file added source/core/assets/images/spanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified source/core/assets/images/turret-select/wall-tower-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
219 changes: 120 additions & 99 deletions source/core/assets/images/ui/buttons/glass.atlas

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions source/core/assets/images/ui/buttons/glass.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,87 @@ com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
a: 1
}
}
pierce_tower_selected: {
name: pierce-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
ricochet_tower_selected: {
name: ricochet-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
firework_tower_selected: {
name: firework-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
pierce_tower_disabled: {
name: pierce-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
ricochet_tower_disabled: {
name: ricochet-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
firework_tower_disabled: {
name: firework-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
pierce_tower_over: {
name: pierce-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
ricochet_tower_over: {
name: ricochet-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
firework_tower_over: {
name: firework-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
}
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: {
Expand Down Expand Up @@ -396,6 +477,24 @@ com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: {
imageCheckedDown: mine_tower_down
imageCheckedOver: mine_tower_over
}
pierce_tower: {
imageUp: pierce-tower-default
imageDown: pierce_tower_selected
imageOver: pierce_tower_over
imageDisabled: pierce_tower_disabled
}
ricochet_tower: {
imageUp: ricochet-tower-default
imageDown: ricochet_tower_selected
imageOver: ricochet_tower_over
imageDisabled: ricochet_tower_disabled
}
fireworks_tower: {
imageUp: firework-tower-default
imageDown: firework_tower_selected
imageOver: firework_tower_over
imageDisabled: firework_tower_disabled
}
}
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: {
Expand Down
Binary file modified source/core/assets/images/ui/buttons/glass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ public class ForestGameArea extends GameArea {
"sounds/mobs/archerArrow.mp3"

};
private static final String backgroundMusic = "sounds/background/Sci-Fi1.ogg";
private static final String BACKGROUND_MUSIC = "sounds/background/Sci-Fi1.ogg";

private static final String[] forestMusic = {backgroundMusic};
private static final String[] forestMusic = {BACKGROUND_MUSIC};
private Entity player;
private Entity waves;

Expand Down Expand Up @@ -888,7 +888,7 @@ private void spawnDroidTower() {
}

private void playMusic() {
Music music = ServiceLocator.getResourceService().getAsset(backgroundMusic, Music.class);
Music music = ServiceLocator.getResourceService().getAsset(BACKGROUND_MUSIC, Music.class);
music.setLooping(true);
music.setVolume(0.3f);
music.play();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CurrencyDisplay extends UIComponent {
private TextButton scrapsTb;
private TextButton crystalsTb;
private Sound clickSound;
private static final String defaultFont = "determination_mono_18";
private static final String DEFAULT_FONT = "determination_mono_18";

/**
* Adds actors to stage
Expand Down Expand Up @@ -74,7 +74,7 @@ private void addActors() {
private TextButton createButton(String imageFilePath, int value) {
Drawable drawable = new TextureRegionDrawable(new TextureRegion(new Texture(imageFilePath)));
TextButton.TextButtonStyle style = new TextButton.TextButtonStyle(
drawable, drawable, drawable, getSkin().getFont(defaultFont));
drawable, drawable, drawable, getSkin().getFont(DEFAULT_FONT));

// create button
TextButton tb = new TextButton(String.format("%d", value), style);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

public class EngineerCountDisplay extends UIComponent {
private TextButton engineerTb;
private static final String defaultFont = "determination_mono_18";

private static final String DEFAULT_FONT = "determination_mono_18";

private static final float Z_INDEX = 2f;

@Override
public void create() {
super.create();
Expand All @@ -41,7 +44,7 @@ private void addActors() {
Drawable drawable = new TextureRegionDrawable(new TextureRegion(
new Texture("images/engineers/engineerBanner.png")));
TextButton.TextButtonStyle style = new TextButton.TextButtonStyle(
drawable, drawable, drawable, getSkin().getFont(defaultFont));
drawable, drawable, drawable, getSkin().getFont(DEFAULT_FONT));

String text = String.format("%d", ServiceLocator.getGameEndService().getEngineerCount());
engineerTb = new TextButton(text, style);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public class GameAreaDisplay extends UIComponent {
private static final Logger logger = LoggerFactory.getLogger(GameAreaDisplay.class);

private static final String DEFAULT_STYLE = "default";
private String gameAreaName = "";
private Label title;

Expand Down Expand Up @@ -45,19 +45,20 @@ private Dialog createTowerDetailsDialog() {
Label.LabelStyle labelStyle = new Label.LabelStyle();
labelStyle.font = new BitmapFont();
labelStyle.fontColor = Color.WHITE;
skin.add("default", labelStyle);
skin.add(DEFAULT_STYLE, labelStyle);

// Create the dialog using the registered label style
Dialog dialog = new Dialog("Tower Details", skin,"default");
Dialog dialog = new Dialog("Tower Details", skin, DEFAULT_STYLE);
dialog.text("Health: 100"); // Set tower health here
dialog.getContentTable().row();
dialog.text("Attack: 50"); // Set tower attack here
dialog.button("Close");
dialog.setVisible(false); // Hide the dialog initially
return dialog;
}

private void addActors() {
title = new Label(this.gameAreaName, skin, "default");
title = new Label(this.gameAreaName, skin, DEFAULT_STYLE);
stage.addActor(title);
}

Expand All @@ -68,7 +69,6 @@ public void draw(SpriteBatch batch) {
float offsetY = 30f;

title.setPosition(offsetX, screenHeight - offsetY);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class PauseMenuButtonComponent extends UIComponent {
private static final float Z_INDEX = 2f;
private Window window;
private final GdxGame game;
private static final float windowSizeX = 300;
private static final float windowSizeY = 400;
private static final float WINDOW_SIZE_X = 300;
private static final float WINDOW_SIZE_Y = 400;
private final String[] sounds = {
"sounds/ui/click/click_01.ogg",
"sounds/ui/open_close/close_01.ogg",
Expand Down Expand Up @@ -119,20 +119,23 @@ public void changed(ChangeEvent changeEvent, Actor actor) {
window.add(planetSelectBtn).center();
window.row();
window.add(mainMenuBtn).center();
window.setWidth(windowSizeX);
window.setHeight(windowSizeY);
window.setX((ServiceLocator.getRenderService().getStage().getWidth() / 2) - (windowSizeX / 2));
window.setY((ServiceLocator.getRenderService().getStage().getHeight() / 2) - (windowSizeY / 2));

window.setWidth(WINDOW_SIZE_X);
window.setHeight(WINDOW_SIZE_Y);
window.setX((ServiceLocator.getRenderService().getStage().getWidth() / 2) - (WINDOW_SIZE_X / 2));
window.setY((ServiceLocator.getRenderService().getStage().getHeight() / 2) - (WINDOW_SIZE_Y / 2));

// Animate the pause menu opening
window.setPosition(((float) Gdx.graphics.getWidth() / 2) - (windowSizeX / 2),0);
window.setPosition(((float) Gdx.graphics.getWidth() / 2) - (WINDOW_SIZE_X / 2),0);
window.addAction(new SequenceAction(Actions.moveTo(
( ((float) Gdx.graphics.getWidth() / 2) - (windowSizeX / 2) ),
( ((float) Gdx.graphics.getHeight() / 2) - (windowSizeY / 2) ),
( ((float) Gdx.graphics.getWidth() / 2) - (WINDOW_SIZE_X / 2) ),
( ((float) Gdx.graphics.getHeight() / 2) - (WINDOW_SIZE_Y / 2) ),
0.3f,
Interpolation.fastSlow),
Actions.fadeIn(0.3f)));



stage.addActor(window);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public class PauseMenuTimeStopComponent extends Component {
private Array<Entity> freezeList;
public PauseMenuTimeStopComponent() {
// Not implemented
}

/**
Expand Down
Loading

0 comments on commit 4cf94e6

Please sign in to comment.