Skip to content

Commit

Permalink
music update, added dynamic realtime song and artist name and 20 new …
Browse files Browse the repository at this point in the history
…songs
  • Loading branch information
mklemmingen committed Jan 10, 2024
1 parent c5ceb80 commit f0f9dd1
Show file tree
Hide file tree
Showing 29 changed files with 279 additions and 351 deletions.
Binary file added assets/Misc/katIncluded.mp3
Binary file not shown.
Binary file added assets/loadingScreen/KatLoading.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/music/03 Warm Breeze.mp3
Binary file not shown.
Binary file added assets/music/Boss Battle.mp3
Binary file not shown.
Binary file added assets/music/KleptoLindaCavernsB.wav
Binary file not shown.
Binary file added assets/music/SeeingDouble.wav
Binary file not shown.
Binary file added assets/music/Start.mp3
Binary file not shown.
Binary file added assets/music/TypeCastTheme.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
199 changes: 136 additions & 63 deletions core/src/com/boomchess/game/BoomChess.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
Expand Down Expand Up @@ -139,7 +139,7 @@ public class BoomChess extends ApplicationAdapter {

// music
public static MusicPlaylist background_music;
public static Music menu_music;
public static MusicPlaylist menu_music;

// universal Buttons -- here for music and sound control

Expand Down Expand Up @@ -202,7 +202,7 @@ public class BoomChess extends ApplicationAdapter {
public static RandomImage obstacleTextures;

// for the credits
public MusicPlaylist creditsMusic;
public static MusicPlaylist creditsMusic;

// for the boolean value if the game is in medieval mode

Expand Down Expand Up @@ -303,8 +303,6 @@ public class BoomChess extends ApplicationAdapter {
public static Texture credits;
public static Texture extendedCredits;

public static float sliderSize;

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

public static Sound katIncluded;
Expand Down Expand Up @@ -360,7 +358,8 @@ public class BoomChess extends ApplicationAdapter {

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

// for the possible colors of textures
// for the possible colors of textures, loaded so we don't have to change each pixel of the
// standard numbers, this way costs less processing power

public static Texture redOne;
public static Texture greenOne;
Expand Down Expand Up @@ -405,17 +404,34 @@ public class BoomChess extends ApplicationAdapter {

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

// black circle
// black circle behind the health number

public static Texture blackCircle;

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

// stage for the current song name that is playing

public static Stage songNameStage;
public static Label musicLabel;
public static float musicLabelScale;

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

@Override
public void create() {
// creation of the batch for drawing the images
batch = new SpriteBatch();

// loading Screen is going till loading complete and main menu starts ----------------------------
// loading Screen is going till loading complete and main menu starts -------------

// skin of the UI --------------------
// skin (look) of the buttons via the prearranged json file
skin = new Skin(Gdx.files.internal("menu.commodore64/uiskin.json"));

// initialises the tile size for relative positioning of stages
RelativeResizer.init();
// sets public tilesize variable and skin bitmap size for button scale

loadingScreenTextures = new RandomImage();
loadingScreenTextures.addTexture("loadingScreen/BoomSoftware.png");
Expand All @@ -439,9 +455,7 @@ public void create() {
inGamOptStage = new Stage(new ScreenViewport());
backgroundStage = new Stage(new ScreenViewport());
damageNumberStage = new Stage(new ScreenViewport());

// initialises the tile size for relative positioning of stages
RelativeResizer.init(); // sets public tilesize variable
songNameStage = new Stage(new ScreenViewport());

// resize all stages for the beginning
resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Expand Down Expand Up @@ -489,6 +503,10 @@ public void render() {

Gdx.gl.glClearColor(1, 1, 1, 1);

// checks if the screen has been resized and if it has, it changes tileSize for relative
// stage creation
RelativeResizer.ensure();

if (loadingScreenIsRunning){
loadingStage.act();
loadingStage.draw();
Expand All @@ -500,6 +518,7 @@ public void render() {
// ensures game starts in menu
createMainMenuStage();
loadingStage.clear();
Gdx.app.log("LoadingScreen", "LoadingScreen finished");
}
// load the assets first time
if(!(assetsLoaded)){
Expand Down Expand Up @@ -578,6 +597,7 @@ public void render() {
Gdx.input.setInputProcessor(currentStage);
helpStage.act();
helpStage.draw();
Gdx.app.log("Help", "Help is shown");
}

if(showInGameOptions){
Expand All @@ -586,6 +606,10 @@ public void render() {
inGamOptStage.draw();
}

// for the song name stage
songNameStage.act();
songNameStage.draw();

if (actionSequence.getDamageSequenceRunning()){
// update the method playNext
sequenceRunning = true;
Expand Down Expand Up @@ -654,39 +678,20 @@ private static void loadAllAssets() {
/*
This method gets called during the main loading Stage runs
*/
// loading all assets -----------------------------------------------------------------------------------

// for defaulting colour change
isColourChanged = true;

// skin of the UI --------------------
// skin (look) of the buttons via the prearranged json file
skin = new Skin(Gdx.files.internal("menu.commodore64/uiskin.json"));
// music label
// load empty musicLabel and put its position to the lower left of the screen
musicLabel = new Label("", skin);
musicLabel.setPosition(tileSize, tileSize*1.25f);
musicLabel.setColor(Color.BLUE);
// scale down by 0.75 to 0.25 of current size
musicLabel.setFontScale(musicLabelScale);
songNameStage.addActor(musicLabel);

// Retrieving the font used in the skin
BitmapFont font = skin.getFont("commodore-64");

// Scaling the font depending on the relativresizer calculated tile size

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

// Optionally, update the skin with the scaled font if needed
skin.add("commodore-64", font, BitmapFont.class);


// assets
// assets ------------------------------------------------------------------------

greenMove = new Image(new Texture(Gdx.files.internal("moveLogos/green_Move.png")));
redMove = new Image(new Texture(Gdx.files.internal("moveLogos/red_Move.png")));
Expand Down Expand Up @@ -1016,26 +1021,70 @@ private static void loadAllAssets() {
queenSound.addSound("sounds/sword/sword7.mp3");
kingSound = queenSound;

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

// load the background music into MusicPlaylist object --------------------------------------
background_music = new MusicPlaylist();
background_music.addSong("music/Breakdown.mp3"); // song added by Artist Wumbatz
background_music.addSong("music/A Little R & R.mp3");
background_music.addSong("music/24 Stray cat.mp3");
background_music.addSong("music/05 Thought Soup.mp3");
background_music.addSong("music/06 Tonal Dissonance.mp3");
background_music.addSong("music/27 Coffee Break.mp3");
background_music.addSong("music/36 Tonal Resonance.mp3");
background_music.addSong("music/epic-battle.mp3");
background_music.addSong("music/Outside the Colosseum.mp3");
background_music.addSong("music/Song Idee Chess.mp3"); // song added by Artist Wumbatz
background_music.addSong("music/Song 2.mp3"); // song added by Artist Wumbatz
background_music.addSong("music/Breakdown.mp3",
"Breakdown", "Wambutz");
background_music.addSong("music/A Little R & R.mp3",
"A Little R & R", "Bert Cole\nbitbybitsound.com");
background_music.addSong("music/24 Stray cat.mp3",
"Stray cat", "Garo");
background_music.addSong("music/05 Thought Soup.mp3",
"Thought Soup", "Garo");
background_music.addSong("music/06 Tonal Dissonance.mp3",
"Tonal Dissonance", "Garo");
background_music.addSong("music/27 Coffee Break.mp3",
"Coffee Break", "Garo");
background_music.addSong("music/36 Tonal Resonance.mp3",
"Tonal Resonance", "Garo");
background_music.addSong("music/epic-battle.mp3",
"Epic Battle", "Bert Cole\nbitbybitsound.com");
/*
// TODO not vibing
background_music.addSong("music/Outside the Colosseum.mp3",
"Outside the\n Colosseum", "Bert Cole\nbitbybitsound.com");
*/
background_music.addSong("music/Song Idee Chess.mp3",
"Song Idee Chess", "Wambutz");
background_music.addSong("music/Song 2.mp3", "Song 2",
"Wambutz");
/*
// TODO too loud
background_music.addSong("music/Boss Battle.mp3", "Boss Battle",
"nostalgiac");
*/
background_music.addSong("music/TypeCastTheme.wav", "TYPE:CAST",
"Not Jam");
background_music.addSong("music/SeeingDouble.wav", "Seeing Double",
"Not Jam");


wrongMoveLogo = new Texture("Misc/WrongMove.png");

// load the menu music

menu_music = Gdx.audio.newMusic(Gdx.files.internal
("music/(LOOP-READY) Track 1 - Safe Zone No Intro.mp3"));
menu_music = new MusicPlaylist();
menu_music.addSong("music/(LOOP-READY) Track 1 - Safe Zone No Intro.mp3",
"Safe Zone", "HZSMITH");
menu_music.addSong("music/KleptoLindaCavernsB.wav",
"CavernsB", "not jam");
menu_music.addSong("music/03 Warm Breeze.mp3",
"Warm Breeze", "rachel wang");
menu_music.addSong("music/Start.mp3", "Start", "Smody");

creditsMusic = new MusicPlaylist();
creditsMusic.addSong("music/credits/Hadokowa - Loading.. - 03 囡囡 (NanNan).mp3",
"NanNan", "Hadokowa");

// TODO elaborate on this Song cause wow
// creditsMusic.addSong("music/credits/Hadokowa - Loading.. - 04 買狗養狗 (Get a Dog,\n Pet a Dog).mp3",
// "Get a Dog, Pet a Dog", "Hadokowa");


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

// ---------------------------- universal Buttons for adding to stages

Expand Down Expand Up @@ -1063,15 +1112,13 @@ public void clicked(InputEvent event, float x, float y) {
soundVolume = 0.25f;
volume = 0.25f;

background_music.setVolume(volume);
menu_music.setVolume(volume);
} else {

soundVolume = 0;
volume = 0;
background_music.setVolume(volume);
menu_music.setVolume(volume);
}
background_music.setVolume(volume);
menu_music.setVolume(volume);
}
});

Expand All @@ -1080,6 +1127,12 @@ public void clicked(InputEvent event, float x, float y) {
public void changed(ChangeEvent event, Actor actor) {
if (currentState != GameState.NOT_IN_GAME) {
background_music.nextSong();
} else {
if(menu_music.isPlaying()) {
menu_music.nextSong();
} else {
creditsMusic.nextSong();
}
}
}
});
Expand Down Expand Up @@ -1175,8 +1228,6 @@ public void changed(ChangeEvent event, Actor actor) {
// set number obstacle for initialization to 3
numberObstacle = 3;

loadingSound.stop();

// intialise the possibleMoveOverlay
possibleMoveOverlay = new Stage();

Expand All @@ -1202,6 +1253,7 @@ public void changed(ChangeEvent event, Actor actor) {
clipBoard = new Texture(Gdx.files.internal("Misc/clipboard.png"));
createInGameOptionStages();

Gdx.app.log("BoomChess", "Loading Assets: Finished");
// leaves the loading screen
assetsLoaded = true;
}
Expand Down Expand Up @@ -1630,7 +1682,8 @@ private void updateMoveLogo() {

// Position at upper left corner
float xPosition = tileSize / 3; // Left edge of the screen
float yPosition = Gdx.graphics.getHeight() - height;// Subtract height of the mover, positioning it at the top
float yPosition = Gdx.graphics.getHeight() - height;
// Subtract height of the mover, positioning it at the top
currentMover.setPosition(xPosition, yPosition);


Expand Down Expand Up @@ -1682,9 +1735,23 @@ public static void createMainMenuStage() {
/*
* method for creating the stage for the main menu
*/

//stop background music
if(background_music.isPlaying()) {
background_music.stop();
}
if(creditsMusic.isPlaying()) {
creditsMusic.stop();
}

inTutorial = false;
switchToStage(MenuStage.initializeUI());
gameEndStage.clear();

if(!(menu_music.isPlaying())) {
// start menu music
menu_music.play();
}
}

public static void createOptionsStage() {
Expand All @@ -1698,6 +1765,12 @@ public static void createCreditsStage() {
/*
* method for creating the stage for the credits display
*/
// stop menu music
menu_music.stop();
// start credits music
if(!(creditsMusic.isPlaying())) {
creditsMusic.play();
}
switchToStage(CreditsStage.initializeUI());
}

Expand Down Expand Up @@ -1831,7 +1904,8 @@ 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 = new Coordinates();
new Coordinates();
Coordinates iconTileCoordinate;

iconTileCoordinate = calculateTileByPX(pxCoordinateX, pxCoordinateY);

Expand Down Expand Up @@ -2012,8 +2086,7 @@ public static Coordinates findGeneral(boolean isRedGeneral) {
public static void addCrossOfDeath(int x, int y) {
Image cross = new Image(BoomChess.crossOfDeathTexture);
Coordinates coordinates = BoomChess.calculatePXbyTile(x, y);
cross.setPosition((float) coordinates.getX() - (tileSize / 2),
(float) coordinates.getY() - (tileSize / 2));
cross.setPosition((float) coordinates.getX() - (tileSize / 2), (float) coordinates.getY() - (tileSize / 2));
cross.setSize(tileSize, tileSize);
BoomChess.crossOfDeathStage.addActor(cross);
}
Expand Down
1 change: 0 additions & 1 deletion core/src/com/boomchess/game/backend/BOT.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ public static void moveSoldierTo(int SX, int SY, int x, int y){
* this method moves a soldier to a specific position
* it utilizes the update function in Board.java
*/
Soldier[][] gameBoard = Board.getGameBoard();

// DottedLine between old coordinates and new coordinates
BoomChess.addDottedLine(SX, SY, x, y, false);
Expand Down
Loading

0 comments on commit f0f9dd1

Please sign in to comment.