Develop a comprehensive suite of unit tests

Assignment Help JAVA Programming
Reference no: EM132296403

Java Programming Assignment

Your solution must be clearly separated into two separate parts, in separate Java packages:

• Part 1: (in moduleboardgame_engine): your Game Engineclasses with Unit Tests.
• Part 2: (in moduleboardgame-gui): a JavaFX GUI that allows users to play your game.

Overview
Your first task is to choose a simple one-player, two-dimensional (2D) boardgame, and then implement the 'engine' of that game in Java. You should write some unit tests to check that your game logic works correctly.

You second task is to use JavaFX to add a graphical user interface (GUI) to your game, which displays the 2D board and allows the user to play the game. So you must keep the basic game idea fairly simple, and ensure that it is not too hard to add the GUI to it.You MUST use JavaFX, not any other Java GUI libraries.

Learning Objectives
1. Learn to use object-oriented design (OOD) to design Java programs;
2. Be able to use inheritance and subtyping relationships between classes;
3. Be able to use association or composition relationships between classes;
4. Be able to develop a comprehensive suite of unit tests for the core logic classes of an application (e.g., for the game engine);
5. Build simple graphical user interfaces using JavaFX.

Choice of Game
Your game needs to be a simple 2D game that uses a discrete 2D grid for the playing board, like a chessboard, a Tetris board, a Crosswords board, or a maze.

You must choose one of the following games (from

1. Car Champ. A puzzle involving moving cars around to escape.
2. Word Grid. Like crosswords, but with a given set of words.
3. Minesweeper. A well-known logic puzzle.
4. Peggy. A bit like draughts/checkers but simpler.
5. Columns. This is like the classic Tetris game, but simpler. Or you could do ColorLines, which is also similar, but you will have to implement a 'path-finding' algorithm to move the balls around.
6. Raku. A color-flipping puzzle.
7. Sokoban. A block-pushing puzzle.
8. Concentration memory game

Part 1: Game Engine

1. Set up your GitRepository.When you click on the Blackboard link for this assignment, you will automatically create your own private GitHub repository containing two simple modules: boardgame_engine and boardgame-gui.
a. Clone this repository onto your computer using IntelliJ.
b. Make sure you also have Java JDK 11 installed on your computer.

2. Check you canrun JavaFX.I have set up the boardgame-gui project to use the 'Gradle' build tool, which means that it should automatically download and install the necessary JavaFX and JUnit libraries when you build and run the project on each new computer.(You may see a popup message down the bottom of IntelliJ: "Gradle projects need to be imported". Click on "Enable Auto-Import" and IntelliJ will automatically download and install JavaFX for you! If IntelliJ asks you for the location of Gradle, you may need to turn off the "Use local gradle distribution" and select the alternative option: "Usegradle 'wrapper' task configuration" - this uses the gradle that is built into IntelliJ). Run the RunGame class to check that you can run the GUI - it should show a simple GUI with a single button that says: "Amazing Board Game coming soon...". (If this does not work on your computer, then follow the same steps that you did in Task 1 to create a JavaFX library and add it to your project (See Blackboard / Learning Materials / Resources and Links if you need instructions). Then check that you can run RunGame.java.)

3. Data Design Decisions:Think carefully about whether each cell in your board should be a primitive value (like a boolean, an integer, or an enum value), or should it be an object? Using objects is more flexible, since it allows you to use Java subtyping to make different cells have different behaviour. But many of the games suggested above do not require the cells to have fancy behaviour, so a primitive value might be sufficient for your game.

4. Implement and Test Your Game Engine:I strongly suggest that you use TDD to develop your unit tests and game engine at the same time, in parallel. Recall: Write a test for each new feature and check that it fails, then implement that feature in your engine classes and rerun the test to check that it now passes. Repeat... You can refactor (rename and reorganise) your code at any stage, if you see a way of making it simpler and more elegant. By the time you have finished implementing your game engine, one (or several) of your tests should be stepping through a complete game from start to end, calling the methods of your engine API and checking the results, including the game win/lose verdict at the end.

5. Class Relationships:To get high marks, your engine needs to include several Java classes, with some association/composition relationships between them, and if possible, some inheritance relationships. Think about where you can best use these Java features.

Part 2: Game GUI

The goal of this stageis to use JavaFX to add an elegant and fully functional GUI to your game so that it can more easily be played on desktop computers. Your GUIshould have the following features:
• event-handling of mouse and/or keyboard events;
• display of bitmap images (I recommend you use some large images for the background of the whole game or each panel, so that the game looks professional and entertaining);
• multiple panels, with a main gaming panel to display the game, plus one or more panels around the edges to display game options, score information, and control and help buttons etc.;
• correct resize behaviour when the user adjusts the main window to different sizes for different devices;
• a clean separation between theback-end (game engine) and front-end (GUI) classes using different Java package names, as described above;
• [optional] use of a timer to have ongoing real-time activity in the game (for example, to make the blocks fall in the Columns game).
Start by drawing one or two paper sketches of the GUI you plan to build. Take a photo of each sketch, as you will need to include these in your final report.

Attachment:- Java Programming Assignment.rar

Reference no: EM132296403

Questions Cloud

Analyze some dependencies between data mining : Analyze some dependencies between data mining and the construction of a data warehouse.
Describe the type of sales willy loman was involved in : When did the story take place and how does the American culture and business climate at that time relate to a central theme in the play?
How concept relates to lesson on gene expression : Transcriptomes. The complete set of all DNA in a cell is called the genome. The complete set of all the mRNA in a cell is called the transcriptome.
Describe integration with other systems and infrastructure : Describe the integration with other systems and infrastructure. Note: Database and interface design, security, and networking should be considered.
Develop a comprehensive suite of unit tests : ICT221 Object-Oriented Programming - The University of the Sunshine Coast - choose a simple one-player, two-dimensional (2D) boardgame, and then implement
State problem or issue - how does it relate to your context : EDF5691 Professional Project Assignment, Monash University, Australia. State problem or issue - How does it relate to your context
Discuss five phases of the systems development life cycle : List and discuss the four different perspectives of the Balanced Scorecard Framework as they relate to a firm's strategy and achieving shareholder value.
How is the product superior to the competitors : For your product, describe the unique selling proposition. How is this product superior to the competitors you identified above.
Halliburton stakeholders from menendez-halliburton scandal : Briefly elaborate on three positive and three negative effects on Halliburton's stakeholders from the Menendez-Halliburton scandal.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd