Skip to content

Commit

Permalink
animations implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
mklemmingen committed Jan 11, 2024
1 parent e0cb242 commit 23afc93
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 673 deletions.
Binary file removed assets/loadingScreen/BoomSoftware.png
Binary file not shown.
10 changes: 7 additions & 3 deletions core/src/com/boomchess/game/BoomChess.java
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ private void loadAllAssets() {
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");
"A Little R & R", "Bert Cole");
background_music.addSong("music/24 Stray cat.mp3",
"Stray cat", "Garo");
background_music.addSong("music/05 Thought Soup.mp3",
Expand All @@ -1071,7 +1071,7 @@ private void loadAllAssets() {
background_music.addSong("music/36 Tonal Resonance.mp3",
"Tonal Resonance", "Garo");
background_music.addSong("music/epic-battle.mp3",
"Epic Battle", "Bert Cole\nbitbybitsound.com");
"Epic Battle", "Bert Cole");
/*
// TODO not vibing
background_music.addSong("music/Outside the Colosseum.mp3",
Expand Down Expand Up @@ -1862,7 +1862,11 @@ public static void reRenderGame(){
if(currentState == GameState.NOT_IN_GAME || !(inGame)) {
return;
}
// dispose all soldierAnimations from the currentStage stage

// remove all active soldierAnimations
GameStage.clearAllActiveSoldierAnimations();

// disposing all inhabitants of the currentStage
currentStage.clear();

switchToStage(createGameStage(isBotMatch));
Expand Down
23 changes: 6 additions & 17 deletions core/src/com/boomchess/game/frontend/actor/moveBotTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ public class moveBotTile {
private static Image botArm;
private static Stack soldierStack;

private static tileWidget currentTileWidget;

public moveBotTile() {
elapsedTime = 0;
isMoving = false;
movingFinished = false;
}

// method for starting the move
public void startMove(int startX, int startY, int endX, int endY, tileWidget tileWidget) {
public void startMove(int startX, int startY, int endX, int endY) {
/*
* Method to simulate a move (start of the Move)
*/
Expand All @@ -58,18 +56,15 @@ public void startMove(int startX, int startY, int endX, int endY, tileWidget til
this.endX = endX;
this.endY = endY;

/* old way
// manipulate variables for GameStage that select an empty texture for a certain coordinate
BoomChess.setEmptyCoordinate(startX, startY);

// rerender GameStage with new Empty Variables
reRenderGame();
*/

// set the maximum duration fitting the length of the way that the soldier moves
// per 50 pixel, add 0.5f to max duration
// Begin: calculate Vector:

startPx = BoomChess.calculatePXbyTile(startX, startY);
endPx = BoomChess.calculatePXbyTile(endX, endY);

Expand Down Expand Up @@ -99,7 +94,6 @@ public void startMove(int startX, int startY, int endX, int endY, tileWidget til

Soldier[][] gameBoard = Board.getGameBoard();

/*
Soldier soldier = gameBoard[startX][startY];
// load the corresponding image through the Soldier Take Selfie Method
Image soldierImage;
Expand All @@ -108,20 +102,21 @@ public void startMove(int startX, int startY, int endX, int endY, tileWidget til
} else {
soldierImage = new Image(empty);
}
*/

botArm = new Image(BoomChess.botArm);

// soldierStack holds the arm
soldierStack = new Stack();

soldierStack.setSize(BoomChess.tileSize, BoomChess.tileSize);
soldierStack.setVisible(true);

currentTileWidget = tileWidget;
soldierImage.setSize(BoomChess.tileSize, BoomChess.tileSize);
soldierImage.setVisible(true);

// add SoldierImage to the widget and fill it
soldierStack.add(soldierImage);

soldierStack.setVisible(false);
currentTileWidget.setVisibility(false);

if(showArm) {
botArm.setScale(0.75f);
Expand Down Expand Up @@ -163,9 +158,7 @@ public void update(float delta) {
// Move completed
movingFinished = true;
isMoving = false;
/*
BoomChess.resetEmptyCoordinate();
*/
}
}
}
Expand All @@ -180,10 +173,6 @@ private static void renderAt(int currentX, int currentY) {

soldierStack.setVisible(true);
soldierStack.setPosition(currentX, currentY);

currentTileWidget.setVisible(true);
currentTileWidget.setPosition(currentX, currentY);

if(showArm) {
botArm.setVisible(true);
botArm.setPosition(currentX + (0.75f * tileSize), currentY - tileSize);
Expand Down
Loading

0 comments on commit 23afc93

Please sign in to comment.