Skip to content

Commit

Permalink
new damage number system
Browse files Browse the repository at this point in the history
  • Loading branch information
mklemmingen committed Jan 8, 2024
1 parent e6f2676 commit 3dc55c2
Show file tree
Hide file tree
Showing 46 changed files with 384 additions and 27 deletions.
Binary file added assets/Misc/blackCircle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/colourPalette.ase
Binary file not shown.
Binary file added assets/numbers/greenEight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenFive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenFour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenNine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenOne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenSeven.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenSix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenThree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenTwo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/greenZero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeEight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeFive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeFour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeNine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeOne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeSeven.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeSix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeThree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeTwo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/orangeZero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/redEight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/redFive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/redFour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/redNine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/numbers/redOne.png
Binary file added assets/numbers/redSeven.png
Binary file added assets/numbers/redSix.png
Binary file added assets/numbers/redThree.png
Binary file added assets/numbers/redTwo.png
Binary file added assets/numbers/redZero.png
Binary file added assets/numbers/yellowEight.png
Binary file added assets/numbers/yellowFive.png
Binary file added assets/numbers/yellowFour.png
Binary file added assets/numbers/yellowNine.png
Binary file added assets/numbers/yellowOne.png
Binary file added assets/numbers/yellowSeven.png
Binary file added assets/numbers/yellowSix.png
Binary file added assets/numbers/yellowThree.png
Binary file added assets/numbers/yellowTwo.png
Binary file added assets/numbers/yellowZero.png
185 changes: 171 additions & 14 deletions core/src/com/boomchess/game/BoomChess.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ public class BoomChess extends ApplicationAdapter {

// --------------------------------------------

public static Sound boomSoftware;
public static Sound katIncluded;

public static Texture tutorialTexture;
public static boolean inTutorial = false;

// --------------------------------------------

public static int botMovingSpeed = 2;
public static int botMovingSpeed = 1;

// --------------------------------------------

Expand Down Expand Up @@ -358,6 +358,58 @@ public class BoomChess extends ApplicationAdapter {
public static Texture eight;
public static Texture nine;

// --------------------------------------------------------------------------------------------------

// for the possible colors of textures

public static Texture redOne;
public static Texture greenOne;
public static Texture yellowOne;
public static Texture orangeOne;
public static Texture redTwo;
public static Texture greenTwo;
public static Texture yellowTwo;
public static Texture orangeTwo;
public static Texture redThree;
public static Texture greenThree;
public static Texture yellowThree;
public static Texture orangeThree;
public static Texture redFour;
public static Texture greenFour;
public static Texture yellowFour;
public static Texture orangeFour;
public static Texture redFive;
public static Texture greenFive;
public static Texture yellowFive;
public static Texture orangeFive;
public static Texture redSix;
public static Texture greenSix;
public static Texture yellowSix;
public static Texture orangeSix;
public static Texture redSeven;
public static Texture greenSeven;
public static Texture yellowSeven;
public static Texture orangeSeven;
public static Texture redEight;
public static Texture greenEight;
public static Texture yellowEight;
public static Texture orangeEight;
public static Texture redNine;
public static Texture greenNine;
public static Texture yellowNine;
public static Texture orangeNine;
public static Texture redZero;
public static Texture greenZero;
public static Texture yellowZero;
public static Texture orangeZero;

// ----------------------------

// black circle

public static Texture blackCircle;


@Override
public void create() {
// creation of the batch for drawing the images
Expand All @@ -368,9 +420,7 @@ public void create() {
loadingScreenTextures = new RandomImage();
loadingScreenTextures.addTexture("loadingScreen/BoomSoftware.png");
loadingSound = Gdx.audio.newSound(Gdx.files.internal("sounds/countdown.mp3"));

tutorialTexture = new Texture(Gdx.files.internal("Misc/tutorial.png"));

loadingStage = LoadingScreenStage.initalizeUI();

// creating all stage objects
Expand Down Expand Up @@ -409,7 +459,7 @@ public void create() {
buttonWidth = tileSize*2;
buttonHeight = tileSize/2;

boomSoftware = Gdx.audio.newSound(Gdx.files.internal("Misc/BoomSoftwares.mp3"));
katIncluded = Gdx.audio.newSound(Gdx.files.internal("Misc/BoomSoftwares.mp3"));

loadingScreenIsRunning = true;
}
Expand Down Expand Up @@ -443,7 +493,7 @@ public void render() {
loadingStage.act();
loadingStage.draw();
// run loading screen for 3 seconds atleast
if(loadingElapsed < 3){
if(loadingElapsed < 4){
loadingElapsed += Gdx.graphics.getDeltaTime();
} else {
loadingScreenIsRunning = false;
Expand All @@ -454,7 +504,7 @@ public void render() {
// load the assets first time
if(!(assetsLoaded)){
loadAllAssets();
boomSoftware.play(volume);
katIncluded.play(volume);
}
return;
}
Expand Down Expand Up @@ -619,16 +669,16 @@ private static void loadAllAssets() {
// Scaling the font depending on the relativresizer calculated tile size

if (tileSize > 140) {
font.getData().setScale(3f);
font.getData().setScale(2f);
sliderSize = 4f;
} else if (tileSize > 100) {
font.getData().setScale(2f);
font.getData().setScale(1.5f);
sliderSize = 2.5f;
} else if (tileSize > 50){
font.getData().setScale(1.5f);
font.getData().setScale(1);
sliderSize = 1.5f;
} else {
font.getData().setScale(1.5f);
font.getData().setScale(1f);
sliderSize = 1f;
}

Expand Down Expand Up @@ -720,6 +770,59 @@ private static void loadAllAssets() {
threeTOthreeCircle = new Texture(Gdx.files.internal("Misc/threeTothreeCircle.png"));
fiveTOfiveCircle = new Texture(Gdx.files.internal("Misc/fiveTofiveCircle.png"));

// loading coloured numbers
redOne = new Texture(Gdx.files.internal("numbers/redOne.png"));
greenOne = new Texture(Gdx.files.internal("numbers/greenOne.png"));
yellowOne = new Texture(Gdx.files.internal("numbers/yellowOne.png"));
orangeOne = new Texture(Gdx.files.internal("numbers/orangeOne.png"));

redTwo = new Texture(Gdx.files.internal("numbers/redTwo.png"));
greenTwo = new Texture(Gdx.files.internal("numbers/greenTwo.png"));
yellowTwo = new Texture(Gdx.files.internal("numbers/yellowTwo.png"));
orangeTwo = new Texture(Gdx.files.internal("numbers/orangeTwo.png"));

redThree = new Texture(Gdx.files.internal("numbers/redThree.png"));
greenThree = new Texture(Gdx.files.internal("numbers/greenThree.png"));
yellowThree = new Texture(Gdx.files.internal("numbers/yellowThree.png"));
orangeThree = new Texture(Gdx.files.internal("numbers/orangeThree.png"));

redFour = new Texture(Gdx.files.internal("numbers/redFour.png"));
greenFour = new Texture(Gdx.files.internal("numbers/greenFour.png"));
yellowFour = new Texture(Gdx.files.internal("numbers/yellowFour.png"));
orangeFour = new Texture(Gdx.files.internal("numbers/orangeFour.png"));

redFive = new Texture(Gdx.files.internal("numbers/redFive.png"));
greenFive = new Texture(Gdx.files.internal("numbers/greenFive.png"));
yellowFive = new Texture(Gdx.files.internal("numbers/yellowFive.png"));
orangeFive = new Texture(Gdx.files.internal("numbers/orangeFive.png"));

redSix = new Texture(Gdx.files.internal("numbers/redSix.png"));
greenSix = new Texture(Gdx.files.internal("numbers/greenSix.png"));
yellowSix = new Texture(Gdx.files.internal("numbers/yellowSix.png"));
orangeSix = new Texture(Gdx.files.internal("numbers/orangeSix.png"));

redSeven = new Texture(Gdx.files.internal("numbers/redSeven.png"));
greenSeven = new Texture(Gdx.files.internal("numbers/greenSeven.png"));
yellowSeven = new Texture(Gdx.files.internal("numbers/yellowSeven.png"));
orangeSeven = new Texture(Gdx.files.internal("numbers/orangeSeven.png"));

redEight = new Texture(Gdx.files.internal("numbers/redEight.png"));
greenEight = new Texture(Gdx.files.internal("numbers/greenEight.png"));
yellowEight = new Texture(Gdx.files.internal("numbers/yellowEight.png"));
orangeEight = new Texture(Gdx.files.internal("numbers/orangeEight.png"));

redNine = new Texture(Gdx.files.internal("numbers/redNine.png"));
greenNine = new Texture(Gdx.files.internal("numbers/greenNine.png"));
yellowNine = new Texture(Gdx.files.internal("numbers/yellowNine.png"));
orangeNine = new Texture(Gdx.files.internal("numbers/orangeNine.png"));

redZero = new Texture(Gdx.files.internal("numbers/redZero.png"));
greenZero = new Texture(Gdx.files.internal("numbers/greenZero.png"));
yellowZero = new Texture(Gdx.files.internal("numbers/yellowZero.png"));
orangeZero = new Texture(Gdx.files.internal("numbers/orangeZero.png"));

Gdx.app.log("BoomChess", "Loading Assets: HealthNumber assets finished");

// Loading Texture of the map

medievalMaps = new RandomImage();
Expand All @@ -740,6 +843,11 @@ private static void loadAllAssets() {
modernMaps.addTexture("map/map3/map5.png"); // cool black and white map
modernMaps.addTexture("map/map3/map6.png"); // cool black and white map

Gdx.app.log("BoomChess", "Loading Assets: HealthNumber assets");
// black circle

blackCircle = new Texture(Gdx.files.internal("Misc/blackCircle.png"));

// texture for the action Running logo
actionOngoing = new Image(new Texture(Gdx.files.internal("Misc/actionOngoing.png")));
actionOngoing.setSize(tileSize*2.5f, tileSize*1.2f);
Expand Down Expand Up @@ -1422,6 +1530,57 @@ public void dispose() {
background_music.dispose();
menu_music.dispose();
creditsMusic.dispose();

// dispose of all numbers
redOne.dispose();
greenOne.dispose();
yellowOne.dispose();
orangeOne.dispose();

redTwo.dispose();
greenTwo.dispose();
yellowTwo.dispose();
orangeTwo.dispose();

redThree.dispose();
greenThree.dispose();
yellowThree.dispose();
orangeThree.dispose();

redFour.dispose();
greenFour.dispose();
yellowFour.dispose();
orangeFour.dispose();

redFive.dispose();
greenFive.dispose();
yellowFive.dispose();
orangeFive.dispose();

redSix.dispose();
greenSix.dispose();
yellowSix.dispose();
orangeSix.dispose();

redSeven.dispose();
greenSeven.dispose();
yellowSeven.dispose();
orangeSeven.dispose();

redEight.dispose();
greenEight.dispose();
yellowEight.dispose();
orangeEight.dispose();

redNine.dispose();
greenNine.dispose();
yellowNine.dispose();
orangeNine.dispose();

redZero.dispose();
greenZero.dispose();
yellowZero.dispose();
orangeZero.dispose();
}

public static void switchToStage(Stage newStage) {
Expand Down Expand Up @@ -1672,7 +1831,7 @@ public static Coordinates calculateTileByPXNonGDX(int pxCoordinateX, int pxCoord

// method for checking which tile a pxCoordinateX and pxCoordinateY is in, creating the coordinates object
// of the respective tile and returning it
Coordinates iconTileCoordinate;
Coordinates iconTileCoordinate = new Coordinates();

iconTileCoordinate = calculateTileByPX(pxCoordinateX, pxCoordinateY);

Expand Down Expand Up @@ -1932,6 +2091,4 @@ public static int getSpecialMalusValue(Soldier soldier){

return specialValue;
}


}
6 changes: 5 additions & 1 deletion core/src/com/boomchess/game/backend/Soldier.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class Soldier {

protected String teamColor;
protected int health;
public static int standardHealth;
private int standardHealth;

public Soldier(String teamColor, int health) {
this.teamColor = teamColor;
Expand Down Expand Up @@ -79,4 +79,8 @@ public ArrayList<Coordinates> mathMove(int positionX, int positionY) {
}
return possibleMoves;
}

public int getStandardHealth(){
return standardHealth;
}
}
Loading

0 comments on commit 3dc55c2

Please sign in to comment.