Assignment #10 – Part 2Problem DescriptionYou are to complete the design and implementation of the Blox game. No additional files will be provided, as your work will consist of completing the project you began in the previous assignment.You must now implement the rules as presented below (same as before), with a demonstration of such rules provided in an extensive sample run of the program below that. Your implementation must contain the methods declared below and function as expected, but you may create additional methods at your discretion to further divide the task at hand.playGame: This method should take as parameters the map, player location, andthe number of blox in the current game. It should be called from within main instead of printing the map, and should contain the core logic to control the play of a single map. If your main method was developed as expected, it is likely that the only required change to that method would be to replace the printMap call with a playGame call.getMove: This method should be very similar to your getDifficulty method, exceptthat it prompts for movement within the game rather than the difficulty with which to set up a new game. While it is important that it ensure that the input was a movement action, it does not need to determine if that movement is currently allowed.movePlayer: This method should take as parameters the map, player location, and the move just entered by the player. It should return an integer constant corresponding to the status of the move made by the player. There are three possible meaningfully different outcomes from a given player move; 1) the move is blocked, 2) the move is not blocked, or 3) the move is not blocked AND pushes a block into a hole. The return value from this method should indicate which of these is the case, as the playGame method will need this information. However, before returning that value, the method must determine which of them is the case and update the map/player location asappropriate.Game RulesThe 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
Marking Scheme[2 marks] Presentation/Style: Organization, readability, descriptive identifiers,meaningful constants, indentation, and bracket placement.[15 marks] Correctness: Program works without bugs. Implementation of allassigned methods. Submission implements game rules as explained above.[2 marks] Comments: Header and internal.[1 mark] Algorithm: Provide an algorithm for the movePlayer method, and anymethod called by it. You may want to write this first to assist withdeveloping your program.Bonus MarksAll of the following must be implemented efficiently in order to qualify for marks, but can be completely omitted from your submission at no penalty.[5 marks] Part 1 completed correctly and on time.[2 marks] Zoom option: Add an additional movement option to the player that scalesthe size of everything printed by the map, including the player, empty spaces,and the border.[3 marks] Scaling difficulty: Implement a numeric difficulty setting that ranges from 1upwards (decide on a large range that is useful to you). Each time the playercompletes a game increment the difficulty of the next game by 1, instead ofprompting for a new difficulty. This should actually impact gameplay in anon-trivial manner (don't just use it directly as the size and number of blox).[3 marks] Push multiple blocks: Allow the player to push multiple blox arranged inseries as long as the last block in the series has room to move.[2 marks] Creative additions: Come up with something interesting of your owndevising and be sure to document it so that your marker is aware of it. Nopromises, but maybe it will be worth some extra credit.Sample OutputThis should explain the game...Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: eXXXXXXXX XX O * XX P XX XXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): dXXXXXXXX XX O * XX PXX XXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): w2
XXXXXXXX XX O *PXX XX XXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): aXXXXXXXX XX O*P XX XX XXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): aXXXXXXXX XX P XX XX XXXXXXXXYou won!Please select a difficulty - [E]ASY, [M]EDIUM, [H]ARD, or [Q]UIT: mXXXXXXXXXXX XX O O XX O XX ** P* XX XXXXXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): dXXXXXXXXXXX XX O O XX O XX ** P* XX XXXXXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): sXXXXXXXXXXX XX O O XX O XX ** * XX P XXXXXXXXXXXPlease enter a move - UP (W), DOWN (S), LEFT (A), RIGHT (D), or QUIT (Q): dXXXXXXXXXXX X3
Found this document preview useful?
Implementation of Interface for a JAVA Game Assignmentlg...
Recurrence, Relations (RR) and Cellular Automata (CA)lg...