Assignment 10 Part 1: Java Game Interface

Verified

Added on  2019/09/18

|3
|804
|399
Homework Assignment
AI Summary
This assignment requires students to design and implement the interface for a Java game. Students are provided with skeleton code and a library of methods, which they must use to complete the game's functionality. The first part of the assignment focuses on generating game maps based on user-selected difficulty levels. The game involves a player, blocks, and holes, with the goal of pushing blocks into holes. The assignment emphasizes understanding method comments and implementing them correctly. The final submission should allow users to select difficulty levels and display corresponding game maps until the user chooses to quit.
Document Page
Assignment #10 – Part 1
Problem Description
You are to begin the design and implementation of the interface for a Java game
(to be completed in the following assignment). You have been provided with both a
minimal skeleton of the code for the game itself as well as a library of a few fully
developed and documented methods that you must make use of. In order to use this
library file, you must first compile it to create a class file. You can then compile and run
the game file to confirm that it can read the methods and constants of the library.
The skeleton game code you have been provided with contains a number of
methods, each of which is paired with a detailed method comment. Your task is to
complete the development of each of these methods, as well as determine how to best
make use of them within the main method to accomplish the overall goal of the program.
It is very important that you read and understand all of the method comments provided.
Failing to understand the method comments in the library file may result in you not
knowing how to correctly use those methods, while failing to understand those in the
game file may result in you failing to implement them correctly. Ask questions earlier
rather than later.
Your final submission for part 1 should function as follows. While the user
continues to select a difficulty setting (as opposed to quitting) print a map generated to
match the corresponding difficulty setting. An example of this is demonstrated below.
While I have chosen specific dimensions and numbers of blox for each difficulty, you are
encouraged to decide for yourself what these values should be, within reason (the map
should fit on the screen).
Game Rules (not implemented this week)
The player is represented by a 'P'. The player can interact with the game by
moving in one of four directions; up, down, left, and right.
The blox are represented by '*' and the holes by 'O'. The goal of the game is to
push the blox around until each block has filled one of the available holes. The
player pushes blox by standing beside them and moving towards them. If the far
side of the block is clear (or a hole), both the player and the block will move.
If the player pushes one of the blox into a hole, both the block and the hole
disappear (the block filled the hole).
The map is surrounded by a border which is impassable to both the player and
blox.
The player wins the game once every block has been pushed into a hole.
The player loses the game if they quit or walk into a hole that has not been filled.
1
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Sample Output
This should explain the game...
Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: e
XXXXXXX
X X
X P X
X *O X
X X
XXXXXXX
Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: m
XXXXXXXXXX
X X
X P * X
X *O X
X O*O X
X X
XXXXXXXXXX
Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: h
XXXXXXXXXXXX
X X
X * X
X ** O *O X
X O * * X
X *O O X
X *O* P X
X OO*OO X
X X
XXXXXXXXXXXX
Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: m
XXXXXXXXXX
X X
X * X
X *P O X
X O* O X
X X
XXXXXXXXXX
Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: q
>Exit code: 0
Marking Scheme
The program must function as detailed above and as shown in the sample output
in order to receive credit, except where the method comments or instructions specify
otherwise. The methods themselves will be assessed in greater detail in the following
assignment.
2
Document Page
Please refer to Assignment#10-part2 Bonus Marks for more details.
3
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]