Implement and test your game engine

Assignment Help JAVA Programming
Reference no: EM133151969

ICT221 Java Programming Assignment

Your solution must be clearly separated into two separate parts, in separate Java packages:
Part 1: (in packagesavekoalas.engine): your Game Engineclasses with Unit Tests.
Part 2: (in packagesavekoalas.gui): a JavaFX GUI that allows users to play your game.
After you create the project in GitHub classroom, two packages will be created automatically. Please keep that code structure unchanged.

SaveKoalas Game Description

SaveKoalasis a 2D gamein a 10 x 10 grid maze map.Unfortunately, because of bushfire, the map will be in fire after a time limit. The goal is to move the player to save all koalas in the map and leave the map at the exit door within the time limit.
To simplify the design, we assume each movement, or a step, of the play equals to one time unit. The maze map consists ofthe following items:
• An entrance to the maze, which is located at the bottom left grid.
• An exit of the maze, which is located at the top right grid.
• Aplayer, who is place at the entrance at the beginning of a game.
• 5koalas, each of which is placed at a random grid.
• Some traps, each of which is placed at a random grid. Once in a trap, the player needs to use10 stepsto move out of the trap.
• Some magic fountains, each of which is placed at a random grid.Visiting/consuminga fountaincan increasetime limit by 6.

The followings are its key features and settings.
• Tostart a new game:
1. The player input an integer d, the difficulty level of the game. dshould be in the range of 0 - 10, and it has the default value of 5.
2. The player clicks a "Run" button to start the game, which triggers the random generation of the map.

• Random generation of the map:
1. An entrance cell is placed at the bottom left cell.
2. An exit cell is placed at the top right cell.
3. A time limit, which is initially set up as 200 steps.
4. The player will appear in the entrance cell with the step counter as "0".
5. 5koalasareplaced randomly in the map.
6. d traps are placed randomly in the map.
7. (10 - d) fountains are placed randomly in the map.
8. The entrance, exit, koalas, traps, and fountains should not overlap.

• To play a game:
1. The player can move in 4 directions: left, right, up, and down inside the map.Each movement is considered as 1 step,unless stated otherwise.
2. Moving out of a trap uses 10steps.The trap remains there after the visit.
3. Visiting a fountain increases the time limit by 6.After the visit, the fountain is consumed, and the cell becomes empty.
4. Visiting a koalasaves1koala. The koala is picked up, and the cell becomes empty.
5. The game finishes when
• (Win) The player saves all 5 koalas and is at the exit cell. The score is: (time limit - steps of the player).
• (Lose) The time limit has reached. The score is -1.
6. The score is shown at the end of a game.

• Other requirements:
» The game can be played in the text UI in which the interaction is enabled by typing keywords, e.g. "u" for up and "d" for down.
» In the game, different items should be displayed with different icons/symbols.
» Time limit of the map is displayed and updated during the play.
» Steps of the player is displayed and updated during the play.
» The number of saved koalas is displayed and updated during the play.
» In the GUI, a player can play by clicking 4 control buttons.
» In the GUI, a "Help" button to get instructions on the game play.
» In the GUI, a "Save" button to save the game play as a .txt file.
» In the GUI, a "Load" button to load a saved game.

It is recommended that you implement the 'engine' ofthe game first. You should writesome unit tests to check that your game logic works correctly.
Then you can 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. You MUST use JavaFX, not any other Java GUI libraries.Otherwise, the GUI part will be marked as 0.
Learning Objectives
1. Learn to use object-oriented design (OOD) to design Java programs;
2. Be able to use inheritance/interface 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.

Part 1: Game Engine
1. Set up your GitRepository.Follow the assessment link in Github Classroom to automatically create your own private GitHub repository containing one module with two packages: savekoalas.engine and savekoalas.gui.
a. Clone this repository onto your computer using IntelliJ.
b. Make sure you also have Java JDK 15or later installed on your computer.
2. Check you canrun JavaFX.This project uses the 'Gradle' build tool to automatically download and install the necessary JavaFX and JUnit libraries when you build and run the project.
After the build is complete, right-click on "src/main/java/savekoalas/gui/RunGame" and do "Run RunGame.main()". You should see a blank JavaFX GUI pop up.Use this RunGame class every time you want to run your GUI.
3. Data Design Decisions:Think carefully about whether each cell in your map should be a primitive value (like 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.
4. Implement and Test Your Game Engine:GameEngine.java is provided as the base for engine development. You need to add more details to it, and you may also want to add other class files in the "savekoalas.engine" package to support the engine development. TDD is recommended, but not necessary, 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. Text-based play: The main() method of GameEngine class should support a text-based game play in the console.
6. 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/interfaceusage. 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 events, including buttons for starting game and moving up/down/left/right;
• display of bitmap images (I recommend you use some large images for the background of the whole game, and use some small images for different items/cells in the map, 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.;
• a clean separation between theback-end (game engine) and front-end (GUI) classes using different Java package names, as described above;
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: EM133151969

Questions Cloud

What the annual depreciation charge on the machine : Separation pay for laborer laid off upon acquisition of new machine 1,200. What the annual depreciation charge on the machine for 2024
Explain what are baseline measurements : 1. Explain what are baseline measurements? 2. What is Benefits Management, and Why do We Need It?
Service demand-supply and service quality : Explain the relationship between service demand, supply, and service quality. Explain where the "sweet spot" is for demand in relation to capacity in order to e
How netflix has changed its external forces : How netflix has changed its external forces from beginning till now
Implement and test your game engine : Implement and Test Your Game Engine:GameEngine.java is provided as the base for engine development. You need to add more details - Data Design Decisions
Should montes carcados expand the business : Should Montes Carcados expand the business to smaller cities? Why?
Why did the european commission bail out banks : 1.Why are Greece, Ireland, Italy, Portugal, and Spain sometimes referred to as the euro zone's "peripheral countries"?
Calculate the adjusted balance per books : Note and interest collected by the bank on behalf of the company $5,250. Calculate the adjusted balance per books
How much tax on a property assessed : A property owner who owes 8 mills in school taxes, 10 mills in city taxes, and 5 mills in county taxes and who qualifies for a $50,000 homestead exemption would

Reviews

len3151969

5/26/2022 9:46:31 PM

Hi there, the deadline of this assignment very close. So, i wanted to know if you guys will be able to finish it before the deadline or not. And also the cost of it. Thank you! Hope to get the reply soon.

Write a Review

JAVA Programming Questions & Answers

  Design a program to help a videorental store

Design classes (class video, class customer, etc) based on your analysis above, using LINKED LISTS for the database elements read into the main memory.

  What are the differences and connections between these two

Do some research on Java application and Java applet. What are the differences and connections between these two? To find out, you might need to be more resourceful than usual.

  Java program that simulates the battle between a cat & mice

Mice have a chance to reproduce as long as required conditions are met. Reproduction only happens when mice are over 1, and 1 of each sex is present.

  Define a trivia class that contains information

Define a Trivia class that contains information about a single trivia question. The question and answer should be defined as instance variables of type String

  Create a project and add to it a class monthlyrecord

Create a project and add to it a class MonthlyRecord. Give this class an instance variable for the name of the month and an array of doubles

  Design and code a swing gui to translate test

Use a FLOWLAYOUT with a JTEXTAREA for the source text and separate JTEXTAREA for the translated text. Add a JBUTTON with an event to perform the translation

  What the code does logically in the program

Compile and run the program. There are ten lines of code marked (1)..(10) that you must explain after analyzing the code, running the program, and examining the output.

  Using the following data definition classpublic class

using the following data definition classpublic class circle private int radiuspublic circleint r radius rpublic int

  Describe a scenario where you use a class

Describe a scenario where you use a class to obtain user input in a Java program. Explain whether the Scanner class or the JOptionPane class

  Print a space after each seat

Given numRows and numCols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat

  Write a program to store information on vehicle owners

This type should be used in the program to store information on vehicle owners. The information we need in this situation is the owner's name and age.

  Number of elements in the array dynamically

When instantiating an array, you can assign the number of elements in the array dynamically, using a variable (as opposed to using a constant). What situation will that be useful? and why?

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