diff --git a/frontend/core/src/com/gameware/game/sprites/LoadingText.java b/frontend/core/src/com/gameware/game/sprites/LoadingText.java index bb70ce29a4dd5fb3c1b7829a07f069ad9662855e..d709c496f1daa7422978edc8ebcf3712dfc3a5e6 100644 --- a/frontend/core/src/com/gameware/game/sprites/LoadingText.java +++ b/frontend/core/src/com/gameware/game/sprites/LoadingText.java @@ -4,6 +4,8 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; +// This is the "Loading..." text that can be seen throughout the application + public class LoadingText extends Sprite { private boolean isLoading = false; private boolean firstUpdateFinished = false; diff --git a/frontend/core/src/com/gameware/game/sprites/PauseButton.java b/frontend/core/src/com/gameware/game/sprites/PauseButton.java index 4105e7effcf306bfbbaa243011858e158afa2a49..ac74936573816e66a52e59c6617f18c2ed2be0ff 100644 --- a/frontend/core/src/com/gameware/game/sprites/PauseButton.java +++ b/frontend/core/src/com/gameware/game/sprites/PauseButton.java @@ -7,6 +7,8 @@ import com.badlogic.gdx.math.Vector3; import javax.xml.soap.Text; +// This is the pause button that is accessible in all minigames + public class PauseButton extends Sprite { private Texture blackButtonTexture; private Texture whiteButtonTexture; diff --git a/frontend/core/src/com/gameware/game/sprites/bubbleWrapSprites/Bubble.java b/frontend/core/src/com/gameware/game/sprites/bubbleWrapSprites/Bubble.java index 3374f9be62890cb97d0276440e9f4fe66d2f15cc..8e00a33b1f9248a88613e33e6eb9448552cdae8f 100644 --- a/frontend/core/src/com/gameware/game/sprites/bubbleWrapSprites/Bubble.java +++ b/frontend/core/src/com/gameware/game/sprites/bubbleWrapSprites/Bubble.java @@ -12,6 +12,8 @@ import com.gameware.game.sprites.Sprite; import java.util.ArrayList; import java.util.Random; +// This is the bubble seen in the Bubble Wrap minigame + public class Bubble extends Sprite { private boolean textureChanged = false; private ArrayList<Texture> poppedTextures; diff --git a/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushButton.java b/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushButton.java index 6cf67a14ee76192d457d0d7fbecd2186ae82e60b..0f81ffcc92b60e3d00d8c6a14331dde81bb6df27 100644 --- a/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushButton.java +++ b/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushButton.java @@ -8,6 +8,8 @@ import com.badlogic.gdx.math.Vector3; import com.gameware.game.GameWare; import com.gameware.game.sprites.Sprite; +// These are the buttons that needs to be pressed according to the matching color of the target in the Color Rush minigame + public class ColorRushButton extends Sprite { private Texture mainTexture; private Texture disabledTexture; diff --git a/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushTarget.java b/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushTarget.java index f637e5eb31241976a364fd9cc47c0ed21511b16d..d8c1c5d49ecde0a027ab0872a0ed87d3ba91d9bf 100644 --- a/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushTarget.java +++ b/frontend/core/src/com/gameware/game/sprites/colorRushSprites/ColorRushTarget.java @@ -6,6 +6,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; +// This is the block that you need to press the matching color to remove in the Color Rush minigame + public class ColorRushTarget extends Sprite { private int nextHeight; private Vector3 velocity; diff --git a/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/Fruit.java b/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/Fruit.java index 8489edb2cd8aeed853fac5aa5bdf0c134aa4b618..fd6c5a278bd14e3e8a3c81ac49a43f9b7dba82a9 100644 --- a/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/Fruit.java +++ b/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/Fruit.java @@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; +// This is the fruit that can be chopped in the Fruit Slicer minigame public class Fruit extends Sprite { private Vector3 cutPosition1; @@ -132,6 +133,7 @@ public class Fruit extends Sprite { @Override public void dispose() { + // Nothing to dispose } public boolean isDisposable() { diff --git a/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/SlicingCircle.java b/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/SlicingCircle.java index afd921a8bed380ffce1776c462d469e5ab69eeb0..b2a84d184243d14e91c155fcda701893b783e37a 100644 --- a/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/SlicingCircle.java +++ b/frontend/core/src/com/gameware/game/sprites/fruitSlicerSprites/SlicingCircle.java @@ -6,6 +6,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; +// This is the circle trail that are left when slicing in the Fruit Slicer minigame + public class SlicingCircle extends Sprite { private Texture slicingVFX; private int originalWidth; diff --git a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/ConfirmationBox.java b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/ConfirmationBox.java index f8760192e28c6d639ddd1cb30bdf60f4f1f3e2b5..5e88acb27a8b25e7817e461666a08661c7120c0d 100644 --- a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/ConfirmationBox.java +++ b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/ConfirmationBox.java @@ -6,6 +6,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; +// This is the confirmation box when trying to exit a minigame when in the pause state + public class ConfirmationBox extends Sprite { private Texture boxTexture; diff --git a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseCircle.java b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseBackgroundCircle.java similarity index 92% rename from frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseCircle.java rename to frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseBackgroundCircle.java index 9a9fe52ab32ae30fb9e69b38136da64e2b3e6164..a2a53677c5da2ceb1dc1d1b4b1f648041e9bdd80 100644 --- a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseCircle.java +++ b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseBackgroundCircle.java @@ -7,12 +7,14 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; -public class PauseCircle extends Sprite { +// These are the animated circles that can be seen in the background of the pause state + +public class PauseBackgroundCircle extends Sprite { private int radius; private Vector3 velocity; private ShapeRenderer sr; - public PauseCircle(){ + public PauseBackgroundCircle(){ this.position = new Vector3(); this.velocity = new Vector3(); diff --git a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseMenuButton.java b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseMenuButton.java index 001e3b3a3f598d1b705db92ebe53b996d8ff2910..8213a34de0e7524261e373ceb505f30893185007 100644 --- a/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseMenuButton.java +++ b/frontend/core/src/com/gameware/game/sprites/pauseStateSprites/PauseMenuButton.java @@ -5,6 +5,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector3; import com.gameware.game.sprites.Sprite; +// This is the button used for "Resume" and "Exit" in the pause state + public class PauseMenuButton extends Sprite { private Texture buttonTexture; diff --git a/frontend/core/src/com/gameware/game/states/PauseState.java b/frontend/core/src/com/gameware/game/states/PauseState.java index ea14fa950749fc0d048ec2b41000c922e12753c6..0185014ef96e9db1add2c80063adaf38242a7a04 100644 --- a/frontend/core/src/com/gameware/game/states/PauseState.java +++ b/frontend/core/src/com/gameware/game/states/PauseState.java @@ -7,7 +7,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.gameware.game.GameWare; import com.gameware.game.sprites.pauseStateSprites.ConfirmationBox; import com.gameware.game.sprites.LoadingText; -import com.gameware.game.sprites.pauseStateSprites.PauseCircle; +import com.gameware.game.sprites.pauseStateSprites.PauseBackgroundCircle; import com.gameware.game.sprites.pauseStateSprites.PauseMenuButton; import com.gameware.game.states.games.PlayStateUnion; @@ -42,7 +42,7 @@ public class PauseState extends State { private boolean needsConfirmation; // Widgets - private List<PauseCircle> pauseCircles; + private List<PauseBackgroundCircle> pauseBackgroundCircles; private ConfirmationBox confirmationBox; private PauseMenuButton resumeButton; private PauseMenuButton exitButton; @@ -63,7 +63,7 @@ public class PauseState extends State { this.countdownDurationLeft = 3f; this.countdownStarted = false; - this.pauseCircles = new ArrayList<PauseCircle>(); + this.pauseBackgroundCircles = new ArrayList<PauseBackgroundCircle>(); this.pausedGame = pausedGame; this.originalFontColor = new Color(this.pausedGame.getFontColor()); @@ -85,7 +85,7 @@ public class PauseState extends State { for(int i = 0; i<25; i++){ - this.pauseCircles.add(new PauseCircle()); + this.pauseBackgroundCircles.add(new PauseBackgroundCircle()); } } @@ -146,7 +146,7 @@ public class PauseState extends State { // If the user has pressed the resume button the countdown has started if(this.countdownStarted){ this.countdownDurationLeft -= dt; - this.countdownNumberTexture = this.countdownNumbers.get(Math.min(Math.max((int) (this.countdownDurationLeft),0), 3)); + this.countdownNumberTexture = this.countdownNumbers.get(Math.min(Math.max((int) (this.countdownDurationLeft),0), 2)); // If the countdown has finished we resume the game if(this.countdownDurationLeft <= 0){ @@ -157,7 +157,7 @@ public class PauseState extends State { } } - for(PauseCircle pc : this.pauseCircles){ + for(PauseBackgroundCircle pc : this.pauseBackgroundCircles){ pc.update(dt); } } @@ -173,7 +173,7 @@ public class PauseState extends State { // Animated circles - for(PauseCircle pc : pauseCircles){ + for(PauseBackgroundCircle pc : pauseBackgroundCircles){ pc.draw(sb); } @@ -213,7 +213,7 @@ public class PauseState extends State { @Override public void dispose() { - for(PauseCircle pc : pauseCircles){ + for(PauseBackgroundCircle pc : pauseBackgroundCircles){ pc.dispose(); } diff --git a/frontend/core/src/com/gameware/game/states/games/BubbleWrapState.java b/frontend/core/src/com/gameware/game/states/games/BubbleWrapState.java index 334e2e9666604bc00c1fdb4d3d286e408b96d47e..ea1a08c3d1656a5964f44e4377fc131e767e7e91 100644 --- a/frontend/core/src/com/gameware/game/states/games/BubbleWrapState.java +++ b/frontend/core/src/com/gameware/game/states/games/BubbleWrapState.java @@ -28,7 +28,7 @@ public class BubbleWrapState extends PlayStateUnion { public BubbleWrapState(GameStateManager gsm) { super(gsm); super.setPauseButtonWhite(); - super.setTotalGameTime(20f); + super.setTotalTimeLimit(20f); super.setFontColorWhite(); super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/BubbleWrap/bubbleWrapPhotoEdit.png"))); @@ -62,7 +62,7 @@ public class BubbleWrapState extends PlayStateUnion { // Keeps score consistent // One point per bubble popped, plus three points for each second of remaining time. Time bonus is only given if the player pops all the bubbles. if(this.poppedBubbles == this.bubbles.size()){ - score = this.poppedBubbles + Math.max(Math.round((super.getTotalGameTime() - super.getCurrentDuration())*3), 0); + score = this.poppedBubbles + Math.max(Math.round((super.getTotalTimeLimit() - super.getCurrentDuration())*3), 0); } else{ score = this.poppedBubbles; diff --git a/frontend/core/src/com/gameware/game/states/games/ColorRushState.java b/frontend/core/src/com/gameware/game/states/games/ColorRushState.java index 5ef9088bd3c13037d8b92e6de458cba6ed3b119a..ba6487b565d588ca1b0282628d58f038dd926a08 100644 --- a/frontend/core/src/com/gameware/game/states/games/ColorRushState.java +++ b/frontend/core/src/com/gameware/game/states/games/ColorRushState.java @@ -27,7 +27,7 @@ public class ColorRushState extends PlayStateUnion { public ColorRushState(GameStateManager gsm){ super(gsm); super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/ColorRush/colorRushPhotoEdit.png"))); - super.setTotalGameTime(30f); + super.setTotalTimeLimit(30f); // Creates the background this.background = new Texture(Gdx.files.internal("gameTextures/ColorRush/ColorRushBackground.jpg")); diff --git a/frontend/core/src/com/gameware/game/states/games/FruitSlicerState.java b/frontend/core/src/com/gameware/game/states/games/FruitSlicerState.java index 82c2c37dc90197386fd055e25971edc5255642e1..1ede5d00dcb8b8d718b6b0589823917e8b18af63 100644 --- a/frontend/core/src/com/gameware/game/states/games/FruitSlicerState.java +++ b/frontend/core/src/com/gameware/game/states/games/FruitSlicerState.java @@ -33,7 +33,7 @@ public class FruitSlicerState extends PlayStateUnion { public FruitSlicerState(GameStateManager gsm) { super(gsm); - super.setTotalGameTime(60f); + super.setTotalTimeLimit(45f); super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/FruitSlicer/FruitSlicerPhotoEdit.png"))); super.setFontColorWhite(); super.setPauseButtonWhite(); @@ -108,7 +108,7 @@ public class FruitSlicerState extends PlayStateUnion { this.timeSinceLastEmit += dt; // Increases the emiting frequency towards the endingEmitFrequency as the game gets closer to the end - float currentFrequency = (float) (this.startingEmitFrequency - (this.startingEmitFrequency - this.endingEmitFrequency) * Math.min(super.getCurrentDuration() / (super.getTotalGameTime() * 0.6), 1)); + float currentFrequency = (float) (this.startingEmitFrequency - (this.startingEmitFrequency - this.endingEmitFrequency) * Math.min(super.getCurrentDuration() / (super.getTotalTimeLimit() * 0.6), 1)); // Emits a new fruit if(this.timeSinceLastEmit > currentFrequency){ diff --git a/frontend/core/src/com/gameware/game/states/games/PlayStateUnion.java b/frontend/core/src/com/gameware/game/states/games/PlayStateUnion.java index 23b18b80c3e99cc3b105c8229b9d1b216692d1af..76d9c16cd9b945e30adce3c2f86212109c0bda1d 100644 --- a/frontend/core/src/com/gameware/game/states/games/PlayStateUnion.java +++ b/frontend/core/src/com/gameware/game/states/games/PlayStateUnion.java @@ -47,7 +47,7 @@ public abstract class PlayStateUnion extends State { // Game values private int score; - protected float totalGameTime = 0f; + protected float totalTimeLimit = 0f; protected float currentDuration = 0f; // Game objects @@ -90,13 +90,13 @@ public abstract class PlayStateUnion extends State { this.loadingText.update(dt); // If the game has a total game time (if the game is time-based) - if(this.totalGameTime > 0f) { + if(this.totalTimeLimit > 0f) { // Increases the current duration, used to keep track of the play duration and stop the game // after a while this.currentDuration += dt; // Set score and start rendering the loading text if the game is over - if (this.currentDuration > this.totalGameTime) { + if (this.currentDuration > this.totalTimeLimit) { this.setGameFinished(); return; } @@ -137,10 +137,10 @@ public abstract class PlayStateUnion extends State { // Renders the text - This is used by this class' render method as well as by the PauseState public void renderText(SpriteBatch sb){ // Shows the current duration if it's supposed to be visible and the game is time-based - if(this.timeLeftVisible && this.totalGameTime > 0f) { + if(this.timeLeftVisible && this.totalTimeLimit > 0f) { sb.begin(); // Time left - this.font.draw(sb, "Time: " + String.valueOf(Math.max(Math.round((this.totalGameTime - this.currentDuration) * 100), 0.00) / 100.0), Gdx.graphics.getWidth() / 40, Gdx.graphics.getHeight() - Gdx.graphics.getHeight() / 20); + this.font.draw(sb, "Time: " + String.valueOf(Math.max(Math.round((this.totalTimeLimit - this.currentDuration) * 100), 0.00) / 100.0), Gdx.graphics.getWidth() / 40, Gdx.graphics.getHeight() - Gdx.graphics.getHeight() / 20); sb.end(); } @@ -254,8 +254,8 @@ public abstract class PlayStateUnion extends State { this.font.setColor(color); } - public void setTotalGameTime(float totalGameTime){ - this.totalGameTime = totalGameTime; + public void setTotalTimeLimit(float totalTimeLimit){ + this.totalTimeLimit = totalTimeLimit; } public void setCurrentDuration(float currentDuration){ @@ -276,8 +276,8 @@ public abstract class PlayStateUnion extends State { return this.currentDuration; } - public float getTotalGameTime(){ - return this.totalGameTime; + public float getTotalTimeLimit(){ + return this.totalTimeLimit; } public Texture getThumbnail(){