diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBlock.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBlock.java index 50106edfd52b16ad225fe70cba9d56721809e5ca..d80b3b74da02cfbd3caaf5630535cbafbd2e74be 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBlock.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBlock.java @@ -4,6 +4,7 @@ import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.value.ObservableValue; import javafx.scene.canvas.Canvas; +import javafx.scene.canvas.GraphicsContext; import javafx.scene.effect.BlendMode; import javafx.scene.paint.*; import org.apache.logging.log4j.LogManager; @@ -64,6 +65,10 @@ public class GameBlock extends Canvas { */ private final IntegerProperty value = new SimpleIntegerProperty(0); + private boolean isCentre = false; + + private boolean isHovering = false; + /** * Create a new single Game Block * @@ -113,22 +118,31 @@ public class GameBlock extends Canvas { //If the block is not empty, paint with the colour represented by the value paintColor(COLOURS[value.get()]); } + + if (isHovering) { + paintHoverTile(); + } + + if (isCentre) { + paintCentreCircle(); + } + } /** * Paint this canvas empty */ private void paintEmpty() { - var gc = getGraphicsContext2D(); + GraphicsContext gc = getGraphicsContext2D(); //Clear - gc.clearRect(0.0D, 0.0D, this.width, this.height); + gc.clearRect(0, 0, this.width, this.height); //Fill - Color gradStart = Color.color(0.0D, 0.0D, 0.6D, 0.3D); - Color gradEnd = Color.color(0.0D, 0.0D, 0.2D, 0.5D); - gc.setFill(new LinearGradient(0.0D, 0.0D, 1.0D, 1.0D, true, CycleMethod.REFLECT, new Stop(0.0D, gradStart), new Stop(1.0D, gradEnd))); - gc.fillRect(0.0D, 0.0D, this.width, this.height); + Color gradStart = Color.color(0.0, 0.0, 0.6, 0.3); + Color gradEnd = Color.color(0.0, 0.0, 0.2, 0.5); + gc.setFill(new LinearGradient(0.0, 0.0, 1.0, 1.0, true, CycleMethod.REFLECT, new Stop(0, gradStart), new Stop(1, gradEnd))); + gc.fillRect(0, 0, this.width, this.height); //Border gc.setStroke(Color.WHITE); @@ -142,21 +156,46 @@ public class GameBlock extends Canvas { * @param colour the colour to paint */ private void paintColor(Paint colour) { - var gc = getGraphicsContext2D(); + GraphicsContext gc = getGraphicsContext2D(); //Clear gc.clearRect(0, 0, width, height); //Colour fill gc.setFill(colour); - gc.setGlobalAlpha(1); gc.fillRect(0, 0, width, height); + gc.setFill(Color.color(1,1,1,0.3)); + gc.fillPolygon(new double[]{0, width, 0}, new double[]{0, 0, height}, 3); + //Border gc.setStroke(Color.BLACK); gc.strokeRect(0, 0, width, height); } + private void paintCentreCircle() { + GraphicsContext gc = getGraphicsContext2D(); + gc.setFill(Color.color(1.0, 1.0, 1.0, 0.6)); + gc.fillOval(this.width / 4, this.height / 4, this.width / 2, this.height / 2); + } + + private void paintHoverTile() { + GraphicsContext gc = getGraphicsContext2D(); + gc.setFill(Color.color(1.0, 1.0, 1.0, 0.4)); + gc.fillRect(0,0, width, height); + } + + public void setCentre() { + this.isCentre = true; + paint(); + } + + public void setHovering(boolean hovering) { + this.isHovering = hovering; + paint(); + } + + /** * Get the column of this block * diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBoard.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBoard.java index 1131d32556301904654d3e80be903938882a54a5..e375840d3d7f8da4f9cc79c9edc72a8681fd4f46 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBoard.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/GameBoard.java @@ -60,6 +60,8 @@ public class GameBoard extends GridPane { protected RightClickListener rightClickListener; + protected boolean isPieceBoard = false; + /** * Create a new GameBoard, based off a given grid, with a visual width and height. * @@ -161,6 +163,11 @@ public class GameBoard extends GridPane { blockRightClicked(block); } }); + + block.setOnMouseEntered(e -> hover(block)); + + block.setOnMouseExited(e -> unhover(block)); + return block; } @@ -183,8 +190,6 @@ public class GameBoard extends GridPane { * @param block block clicked on */ private void blockClicked(GameBlock block) { - logger.info("Block clicked: {}", block); - if (blockClickedListener != null) { blockClickedListener.blockClicked(block); } @@ -196,4 +201,14 @@ public class GameBoard extends GridPane { } } + private void hover(GameBlock block) { + if (isPieceBoard) return; + block.setHovering(true); + } + + private void unhover(GameBlock block) { + if (isPieceBoard) return; + block.setHovering(false); + } + } diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/PieceBoard.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/PieceBoard.java index 5abd200729cf1db9f272d2e508fd3cfa532cf91e..1a8b872733e69851353703e1798479c7b754e41f 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/component/PieceBoard.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/component/PieceBoard.java @@ -7,6 +7,7 @@ public class PieceBoard extends GameBoard { public PieceBoard(double width, double height) { super(3, 3, width, height); + this.isPieceBoard = true; } public void displayPiece(GamePiece piece, int placeX, int placeY) { @@ -26,4 +27,8 @@ public class PieceBoard extends GameBoard { this.blockClickedListener = handler; } + public void drawCentre() { + this.blocks[1][1].setCentre(); + } + } diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/event/NextPieceListener.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/event/NextPieceListener.java index 09971bd2dae205469f3af8bfafb4915169e935f0..77fc3c91c8c568c75114d240290192215a793db2 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/event/NextPieceListener.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/event/NextPieceListener.java @@ -3,5 +3,5 @@ package uk.ac.soton.comp1206.event; import uk.ac.soton.comp1206.game.GamePiece; public interface NextPieceListener { - void nextPiece(GamePiece paramGamePiece); + void nextPiece(GamePiece piece); } diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/game/Game.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/game/Game.java index c32f3c49bc0ee03a06313af22a11fd2e925dc2b2..de325d8cf7670eead4a8d318c798664b05e8e156 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/game/Game.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/game/Game.java @@ -44,7 +44,7 @@ public class Game { private int remainder = 0; - protected NextPieceListener nextPieceHandler = null; + protected NextPieceListener nextPieceListener = null; /** * Create a new game with the specified rows and columns. Creates a corresponding grid model. @@ -118,8 +118,8 @@ public class Game { this.currentPiece = this.nextPiece; this.nextPiece = spawnPiece(); - if (this.nextPieceHandler != null) { - this.nextPieceHandler.nextPiece(this.currentPiece); + if (this.nextPieceListener != null) { + this.nextPieceListener.nextPiece(this.currentPiece); } logger.info("Current piece is : {}", this.currentPiece); @@ -132,7 +132,7 @@ public class Game { ArrayList<Integer> fullCols = new ArrayList<>(); ArrayList<Integer> fullRows = new ArrayList<>(); - /** + /* * Check each vertical column to see if it is full */ for (int x = 0; x < grid.getCols(); x++) { @@ -147,7 +147,7 @@ public class Game { } } - /** + /* * Check each horizontal row to see if it is full */ for (int y = 0; y < grid.getCols(); y++) { @@ -164,7 +164,7 @@ public class Game { int numGridBlocks = 0; - /** + /* * Removes all columns which are full */ for (int x : fullCols) { @@ -176,8 +176,8 @@ public class Game { } } - /** - * Removes all rows which are full + /* + Removes all rows which are full */ for (int y : fullRows) { for (int x = 0; x < grid.getCols(); x++) { @@ -204,7 +204,9 @@ public class Game { Multimedia.playSound("clear.wav"); this.setMultiplier(multiplier.get() + 1); } else { - this.setMultiplier(1); + if (this.getMultiplier().get() > 1) { + this.setMultiplier(1); + } } } @@ -249,8 +251,8 @@ public class Game { return nextPiece; } - public void setOnNextPiece(NextPieceListener handler) { - this.nextPieceHandler = handler; + public void setNextPieceListener(NextPieceListener listener) { + this.nextPieceListener = listener; } public void rotatePiece(int rotations) { diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/ChallengeScene.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/ChallengeScene.java index 265a260626d90bbe60b8352d5ca92bd12906b49e..a30155fc701df90da4b1237f164fc0f3dcc406f6 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/ChallengeScene.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/ChallengeScene.java @@ -4,6 +4,8 @@ import javafx.beans.property.Property; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.geometry.Pos; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyEvent; import javafx.scene.layout.*; import javafx.scene.paint.Color; import javafx.scene.paint.Paint; @@ -20,6 +22,7 @@ import uk.ac.soton.comp1206.ui.GamePane; import uk.ac.soton.comp1206.ui.GameWindow; import uk.ac.soton.comp1206.utility.Multimedia; +import java.security.Key; import java.util.ArrayList; /** @@ -44,6 +47,29 @@ public class ChallengeScene extends BaseScene { logger.info("Creating Challenge Scene"); } + /** + * Initialise the scene and start the game + */ + @Override + public void initialise() { + logger.info("Initialising Challenge"); + Multimedia.playBackgroundMusic("game_start.wav", false); + Multimedia.getBackgroundPlayer().setOnEndOfMedia(() -> Multimedia.playBackgroundMusic("game.wav", true)); + + this.game.setNextPieceListener(this::nextPiece); + + this.scene.setOnKeyPressed(this::keyHandler); + + game.start(); + } + + private void keyHandler(KeyEvent e) { + if (e.getCode().equals(KeyCode.ESCAPE)) { + Multimedia.stopSound(); + this.gameWindow.startMenu(); + } + } + /** * Build the Challenge window */ @@ -151,10 +177,12 @@ public class ChallengeScene extends BaseScene { this.currentPieceBoard = new PieceBoard(gameWindow.getWidth() / 6, gameWindow.getWidth() / 6); this.currentPieceBoard.setOnClick(this::rotateBlock); + this.currentPieceBoard.drawCentre(); gameInfo.getChildren().add(this.currentPieceBoard); this.nextPieceBoard = new PieceBoard(gameWindow.getWidth() / 10, gameWindow.getWidth() / 10); this.nextPieceBoard.setOnClick(this::swapPiece); + this.nextPieceBoard.drawCentre(); gameInfo.getChildren().add(this.nextPieceBoard); gameInfo.setAlignment(Pos.CENTER); @@ -170,6 +198,7 @@ public class ChallengeScene extends BaseScene { private void swapPiece(GameBlock gameBlock) { logger.info("Swapping current and next piece"); + Multimedia.playSound("rotate.wav"); this.currentPieceBoard.displayPiece(this.game.getNextPiece()); this.nextPieceBoard.displayPiece(this.game.getCurrentPiece()); this.game.swapPiece(); @@ -209,19 +238,6 @@ public class ChallengeScene extends BaseScene { game = new Game(5, 5); } - /** - * Initialise the scene and start the game - */ - @Override - public void initialise() { - logger.info("Initialising Challenge"); - Multimedia.playBackgroundMusic("game_start.wav", false); - Multimedia.getBackgroundPlayer().setOnEndOfMedia(() -> Multimedia.playBackgroundMusic("game.wav", true)); - - this.game.setOnNextPiece(this::nextPiece); - game.start(); - } - protected void nextPiece(GamePiece nextPiece) { logger.info("Next piece to place: " + nextPiece); this.currentPieceBoard.displayPiece(nextPiece); diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/InstructionScene.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/InstructionScene.java new file mode 100644 index 0000000000000000000000000000000000000000..5dc8b063a247bbf1b4baafd2503a64e60f6a5183 --- /dev/null +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/InstructionScene.java @@ -0,0 +1,144 @@ +package uk.ac.soton.comp1206.scene; + +import javafx.geometry.Pos; +import javafx.scene.image.ImageView; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyEvent; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; +import javafx.scene.text.TextFlow; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import uk.ac.soton.comp1206.component.GameBlock; +import uk.ac.soton.comp1206.component.PieceBoard; +import uk.ac.soton.comp1206.game.Game; +import uk.ac.soton.comp1206.game.GamePiece; +import uk.ac.soton.comp1206.ui.GamePane; +import uk.ac.soton.comp1206.ui.GameWindow; +import uk.ac.soton.comp1206.utility.Multimedia; + +public class InstructionScene extends BaseScene{ + private static final Logger logger = LogManager.getLogger(InstructionScene.class); + + private int pieceNumber = 0; + + private PieceBoard pieceBoard; + /** + * Create a new scene, passing in the GameWindow the scene will be displayed in + * + * @param gameWindow the game window + */ + public InstructionScene(GameWindow gameWindow) { + super(gameWindow); + + logger.info("Creating Instructions Scene"); + } + + @Override + public void initialise() { + this.scene.setOnKeyPressed(this::escapeToMenu); + } + + @Override + public void build() { + logger.info("Building " + this.getClass().getName()); + + root = new GamePane(gameWindow.getWidth(), gameWindow.getHeight()); + + StackPane instructionsPane = new StackPane(); + instructionsPane.setMaxWidth(gameWindow.getWidth()); + instructionsPane.setMaxHeight(gameWindow.getHeight()); + instructionsPane.getStyleClass().add("menu-background"); + root.getChildren().add(instructionsPane); + + BorderPane mainPane = new BorderPane(); + instructionsPane.getChildren().add(mainPane); + + VBox widgets = new VBox(); + + Text instructionsTitle = new Text("How to Play"); + instructionsTitle.getStyleClass().add("heading"); + widgets.getChildren().add(instructionsTitle); + + + Text instructionsText = new Text("TetrECS is a fast-paced gravity-free block placement game, where you must survive by clearing rows through careful placement of the upcoming blocks before the time runs out. Lose all 3 lives and you're destroyed!"); + TextFlow instructionTextBox = new TextFlow(instructionsText); + instructionsText.getStyleClass().add("instructions"); + instructionTextBox.setTextAlignment(TextAlignment.CENTER); + widgets.getChildren().add(instructionTextBox); + + ImageView instructionsImage = new ImageView(getClass().getResource("/images/Instructions.png").toExternalForm()); + instructionsImage.setPreserveRatio(true); + instructionsImage.setFitWidth(this.gameWindow.getWidth() / 1.5D); + widgets.getChildren().add(instructionsImage); + + Text gamePiecesLabel = new Text("Game Pieces"); + gamePiecesLabel.getStyleClass().add("heading"); + widgets.getChildren().add(gamePiecesLabel); + + HBox pieceBoards = buildPieceBoards(); + widgets.getChildren().add(pieceBoards); + + widgets.setAlignment(Pos.TOP_CENTER); + widgets.setSpacing(10); + + mainPane.setCenter(widgets); + } + + private HBox buildPieceBoards() { + HBox pieceBoardLayout = new HBox(); + + ImageView prevArrow = new ImageView(getClass().getResource("/images/leftArrow.png").toExternalForm()); + prevArrow.setOnMouseClicked(this::displayPrevPiece); + pieceBoardLayout.getChildren().add(prevArrow); + + GamePiece piece = GamePiece.createPiece(pieceNumber); + pieceBoard = new PieceBoard((this.gameWindow.getWidth() / 6), (this.gameWindow.getWidth() / 6)); + pieceBoard.displayPiece(piece); + pieceBoardLayout.getChildren().add(pieceBoard); + + ImageView nextArrow = new ImageView(getClass().getResource("/images/rightArrow.png").toExternalForm()); + nextArrow.setOnMouseClicked(this::displayNextPiece); + pieceBoardLayout.getChildren().add(nextArrow); + + pieceBoardLayout.setAlignment(Pos.CENTER); + pieceBoardLayout.setSpacing(10); + + return pieceBoardLayout; + + } + + private void displayNextPiece(MouseEvent event) { + if (pieceNumber != 14) { + pieceNumber++; + } else { + pieceNumber = 0; + } + + GamePiece piece = GamePiece.createPiece(pieceNumber); + pieceBoard.displayPiece(piece); + } + + private void displayPrevPiece(MouseEvent event) { + if (pieceNumber != 0) { + pieceNumber--; + } else { + pieceNumber = 14; + } + + GamePiece piece = GamePiece.createPiece(pieceNumber); + pieceBoard.displayPiece(piece); + } + + private void escapeToMenu(KeyEvent e) { + if (e.getCode().equals(KeyCode.ESCAPE)) { + Multimedia.stopSound(); + this.gameWindow.startMenu(); + } + } +} diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/MenuScene.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/MenuScene.java index c5797a53fdbb7e27bbb450881006b9e6d5f2b352..04effde106f9708d614cf22c67e2375f51d9dd25 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/MenuScene.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/scene/MenuScene.java @@ -1,5 +1,6 @@ package uk.ac.soton.comp1206.scene; +import javafx.event.EventHandler; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.input.MouseEvent; @@ -8,6 +9,7 @@ import javafx.scene.media.MediaPlayer; import javafx.scene.text.Text; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import uk.ac.soton.comp1206.App; import uk.ac.soton.comp1206.ui.GamePane; import uk.ac.soton.comp1206.ui.GameWindow; import uk.ac.soton.comp1206.utility.Multimedia; @@ -38,7 +40,7 @@ public class MenuScene extends BaseScene { root = new GamePane(gameWindow.getWidth(), gameWindow.getHeight()); - var menuPane = new StackPane(); + StackPane menuPane = new StackPane(); menuPane.setMaxWidth(gameWindow.getWidth()); menuPane.setMaxHeight(gameWindow.getHeight()); menuPane.getStyleClass().add("menu-background"); @@ -49,30 +51,46 @@ public class MenuScene extends BaseScene { VBox menuWidgets = new VBox(); - Region space = new Region(); - space.setPrefHeight(100); - HBox.setHgrow(space, Priority.ALWAYS); - menuWidgets.getChildren().add(space); - //Awful title - var title = new Text("TetrECS"); + Text title = new Text("TetrECS"); title.getStyleClass().add("bigtitle"); menuWidgets.getChildren().add(title); VBox menuButtons = new VBox(); - var singlePlay = new Text("Single Player"); + Text singlePlay = new Text("Single Player"); singlePlay.getStyleClass().add("menuItem"); singlePlay.setOnMouseClicked(this::startGame); menuButtons.getChildren().add(singlePlay); + Text multiPlayLabel = new Text("Multi Player"); + multiPlayLabel.getStyleClass().add("menuItem"); + menuButtons.getChildren().add(multiPlayLabel); + + Text instructions = new Text("How To Play"); + instructions.getStyleClass().add("menuItem"); + instructions.setOnMouseClicked(this::showInstructions); + menuButtons.getChildren().add(instructions); + + Text exitLabel = new Text("Exit"); + exitLabel.getStyleClass().add("menuItem"); + exitLabel.setOnMouseClicked(new EventHandler<MouseEvent>() { + @Override + public void handle(MouseEvent mouseEvent) { + App.getInstance().shutdown(); + } + }); + menuButtons.getChildren().add(exitLabel); + menuButtons.setAlignment(Pos.CENTER); + menuButtons.setSpacing(5); + + menuWidgets.getChildren().add(menuButtons); menuWidgets.setAlignment(Pos.CENTER); + menuWidgets.setSpacing(150); - mainPane.setTop(menuWidgets); - mainPane.setCenter(menuButtons); + mainPane.setCenter(menuWidgets); - Multimedia.playBackgroundMusic("menu.mp3", true); } /** @@ -80,17 +98,20 @@ public class MenuScene extends BaseScene { */ @Override public void initialise() { - + Multimedia.playBackgroundMusic("menu.mp3", true); } /** * Handle when the Start Game button is pressed * - * @param event event */ private void startGame(MouseEvent event) { Multimedia.stopSound(); gameWindow.startChallenge(); } + private void showInstructions(MouseEvent event) { + gameWindow.displayInstructions(); + } + } diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/test.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/test.java new file mode 100644 index 0000000000000000000000000000000000000000..cca7beaf507855620eb4e2a8d0a8e74530bd8dc4 --- /dev/null +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/test.java @@ -0,0 +1,54 @@ +package uk.ac.soton.comp1206; + +import javafx.application.Application; +import javafx.scene.Group; +import javafx.scene.Scene; +import javafx.scene.canvas.Canvas; +import javafx.scene.canvas.GraphicsContext; +import javafx.scene.paint.Color; +import javafx.stage.Stage; + +public class test extends Application { + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Drawing Operations Test"); + Group root = new Group(); + Canvas canvas = new Canvas(300, 250); + GraphicsContext gc = canvas.getGraphicsContext2D(); + drawShapes(gc); + root.getChildren().add(canvas); + primaryStage.setScene(new Scene(root)); + primaryStage.show(); + } + + private void drawShapes(GraphicsContext gc) { + + int firstX = 90; + int secondX = 190; + int thirdX = 10; + + int firstY =30; + int secondY =170; + int thirdY =170; + + gc.setFill(Color.GREEN); + gc.setStroke(Color.BLUE); + gc.fillPolygon(new double[]{firstX, secondX,thirdX}, + new double[]{firstY, secondY, thirdY}, 3); + + gc.strokePolygon(new double[]{firstX, secondX,thirdX}, + new double[]{firstY, secondY, thirdY}, 3); + + gc.setFill(javafx.scene.paint.Color.BLACK); + gc.fillText("1", firstX - 3, firstY - 4); + gc.fillText("2", secondX - 3, secondY - 4); + gc.fillText("3", thirdX - 3, thirdY - 4); + + + } +} diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/ui/GameWindow.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/ui/GameWindow.java index 924668bd356c18b348307e97aed1692ae2da3668..1b0408ddad5e3dd488cb871782254bd56dc51f3e 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/ui/GameWindow.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/ui/GameWindow.java @@ -88,6 +88,10 @@ public class GameWindow { loadScene(new ChallengeScene(this)); } + public void displayInstructions() { + loadScene(new InstructionScene(this)); + } + /** * Setup the default settings for the stage itself (the window), such as the title and minimum width and height. */ diff --git a/tetrecs/src/main/java/uk/ac/soton/comp1206/utility/Multimedia.java b/tetrecs/src/main/java/uk/ac/soton/comp1206/utility/Multimedia.java index a524f1dad28045dc40bbd10fdc2a392e18337895..b99422cebfa1a82860cb6312e023571f34931465 100644 --- a/tetrecs/src/main/java/uk/ac/soton/comp1206/utility/Multimedia.java +++ b/tetrecs/src/main/java/uk/ac/soton/comp1206/utility/Multimedia.java @@ -46,6 +46,7 @@ public class Multimedia { } public static void stopSound() { + logger.info("Stopping all current audio tracks"); if (mediaPlayer != null) { mediaPlayer.stop(); } diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlock.class b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlock.class index 191944d061dfb8e127c3714cc9e7ba0b0dea72d2..808af90aa5b3248584c35fcb8db560e91e5fa62f 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlock.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlock.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlockCoordinate.class b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlockCoordinate.class index de29963eeff81260c4fd827cf833254e1e8f3f2a..a20b83652745ed51e0ad402743af24bcac4b412a 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlockCoordinate.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBlockCoordinate.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBoard.class b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBoard.class index 7d7f7ec15155e1956eee50ce3814870034b662b0..781238acd474eba9b2a2e3287691835c48217712 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBoard.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/component/GameBoard.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/game/Game.class b/tetrecs/target/classes/uk/ac/soton/comp1206/game/Game.class index 9bee46cc02c85f4d236ae529187f1b0a6ca79b2f..a449eff117cc19e136d41dd7a6494a42d597634e 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/game/Game.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/game/Game.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/game/GamePiece.class b/tetrecs/target/classes/uk/ac/soton/comp1206/game/GamePiece.class index ddf9544daf0af815a0ae54f0b67fcb34868d21c6..580673cfa6c805087cf2419b840265615cd04929 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/game/GamePiece.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/game/GamePiece.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/game/Grid.class b/tetrecs/target/classes/uk/ac/soton/comp1206/game/Grid.class index 915e5a5f1411e7a79631ab290a29233d57d65412..dda7f01ba1ac9ba52ef54d6cb3a478b7f95a46ae 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/game/Grid.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/game/Grid.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$1.class b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$1.class index 6cf9ed610db485c27836ddf9faf5b23efdcddf94..abda44096f5c2d3ed642efb0dcc4c79b26164ceb 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$1.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$1.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$2.class b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$2.class index 07139d84c2c6f90d7f2d1cfcf13aa85386d96adc..21785825fa458046db9bc0b5e4dd8ea84ce41b64 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$2.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator$2.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator.class b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator.class index 99b1802aaca6b067117bc3a8accfe11812f42414..974892993abe7ee1d082096ca1d673b565ceab26 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/network/Communicator.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/BaseScene.class b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/BaseScene.class index 09b4b896d839e039f7d0ec3c035aa395856ad37e..e252884720d19dffd51de46627128d39f4a583c5 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/BaseScene.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/BaseScene.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/ChallengeScene.class b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/ChallengeScene.class index 307d07de2a84933ea7a5dc80b9504e5c98c000a8..4ed833df05b29d0433119ea8087b1537728ac426 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/ChallengeScene.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/ChallengeScene.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/MenuScene.class b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/MenuScene.class index ab27c55069861c8e139ae82305e1f07cad2366a0..9da2e51ae65b3730019681f359fe29c48c7382c4 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/scene/MenuScene.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/scene/MenuScene.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GamePane.class b/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GamePane.class index b89f5029abe56275431d1d3109046c4af613db37..aac6d099b65852a7465d1d7c047deefa6723d8bc 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GamePane.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GamePane.class differ diff --git a/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GameWindow.class b/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GameWindow.class index e4fc4bffe0885a514f134baa33bd64f7c118cc4f..0b960e06fab7295baebee34e45c826c20124ffc9 100644 Binary files a/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GameWindow.class and b/tetrecs/target/classes/uk/ac/soton/comp1206/ui/GameWindow.class differ