At the beginning of the game you should ask the user to enter the game mode in which they want to play the game using a dialogue box. CheeseWorld should be populated as specified in Table 1 according to the user choice.
Program CheeseWorld to add Barrel, Cheese, CheekyMouse, Home, LazyCat, MouseTrap objects as required.
Input validation: The only valid user choices are the values recorded in Table 1.
Notes:

  1. CheeseWorld is organised into an 8×8 grid cell. Each object appearing in the grid has a unique grid number and specific x coordinate and y coordinate value.

Add your pseudocode or flowchart for this task to the box.

Task 2: Program the CheekyMouse class
If CheekyMouse is not trapped, the user can move it one cell down, up, left or right with curser keys to find cheese.
If it is trapped, display a message in the console window indicating that it is trapped.
Sample message: CHEEKY MOUSE: Ouch, I’m trapped.
If CheekyMouse reaches its home:

  1. Make the mouse shout hooray.
  2. Stop the Greenfoot scenario.
  3. Display a message in the console window indicating the user wins the game.
  4. Display the count of cheese points the user collected in the console window.

The user can collect one cheese point for every piece of cheese eaten by the CheekyMouse.
Sample message:
CHEEKY MOUSE: Congratulations! You win the Game.
CHEEKY MOUSE: Total cheese points earned=A^
^ replaced by the number of cheese pieces eaten by the CheekyMouse.
Hints:

  1. You may use the methods given in Mouse Class.
  2. For the action, “it shouts hooray”, you should write your own method or, at a minimum, you should play the “hooray.wav”.

Add your pseudocode or flowchart for this task to the box.

Task 3: Program MouseTrap class
Catch the mouse if it steps into the trap.
If it is trapped,

  1. Stop the Greenfoot scenario.
  2. Display a message to the console window indicating in which cell number in the CheeseWorld grid this accident happened.

Sample message: MOUSE TRAP: CheekyMouse is trapped at grid cell xx*.
* xx replaced by the cell number.
Note: The grid numbering pattern is as follows.
Hints:

  1. You may use the methods given in MouseTrap Class to program the act() method.
  2. Use the getX() and getY() methods from Actor Class to find the x coordinate and y coordinate values of the MouseTrap to calculate the Grid number.

Add your pseudocode or flowchart for this task to the box.

Task 4: Program LazyCat
When the LazyCat is created in the CheeseWorld, it is in sleep status by default. However, LazyCat can be in one of two states (sleep/awake) during program execution.
Program the sleep behaviour of the LazyCat. You should display the sleeping cat image (use “small-cat-sleep-3.png”) and set the status to sleep.
Program the awake behaviour. You should display the image “small-cat.png” for the LazyCat. Set the status to awake.
If it is time to wake up, it wakes up. Make it perform a Mouse screening routine. Otherwise it is to go to sleep.
The CheekyMouse screening routine should be programmed as follows:
If it sees the CheekyMouse,

  1. Eat the Mouse.
  2. Dance##.
  3. Stop the Greenfoot scenario.
  4. Display a message to the console window indicating how many cheese it had saved.

Sample message: LAZY CAT: Game Over! No more hassle from CheekyMouse! Saved y** pieces of cheese.
** replaced by the number of Cheese objects left in the world.
The ##Dance routine in Lazy Cat dance consists of the following four steps.
Step 1: Hands in the air
Step 2: Flying
Step 3: Pointing up to the Right
Step 4: Pointing up to the Left.
LazyCat will perform the above four steps 4 times in this specific dance routine. Call the wait() method between each step.
Figure 4 gives the image name and image for each of the above steps.
“linus-song-loop.wav” should play in background during the dance performance.

Figure 4.1: Hands in the air Figure 4.2: Flying Figure 4.3: Pointing up to the Right Figure 4.4: Pointing up to the Left
small-cat-in-air.png small-cat-fly.png small-cat-dance-2.png small-cat-dance.png
Figure 4: Cat images for the dancing routine

Add your pseudocode or flowchart for this task to the box.

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!