Reference no: EM132407539
ICTPRG527 Apply Intermediate Object-Oriented Language Skills, Academies Australasia Polytechnic, Australia
PROGRAM REQUIREMENTS & BRIEF
This assessment requires you to program a game – ‘Rabbit Plague’.
The aim of the game is to “kill” rabbits by clicking on them. The game must keep score of the number rabbits are killed.
The game must end when all the rabbits are killed. (Alternatively, having the game end if there are no more male rabbits or no more female rabbits is encouraged). The game must also end once there are 100 or more rabbits.
When the game ends a message must be displayed to the user and the high score must be updated if the user beat the old high score.
The game must be written in Java and must use graphical user input – swing is recommended.
The game must be developed and run in Eclipse.
You are required to submit your Java source code to the LMS.
HINTS & TIPS
1. Use main to initialise the GUI.
2. Create a “Game” class which extends JFrame. Game holds the game and the main method.
3. Create a “Field” class which extends JPanel.
4. In the Game object, instantiate a Field object add it to the game JFrame.
5. In the Game object, instantiate score and population JPanels and add them to the Game object.
6. Use the JTextArea class to create objects to show the score, high score, number of male rabbits and number of female rabbits. Add these JTextArea objects to the score and population JPanels as appropriate.
7. Create a Rabbit class which extends JButton. Square Rabbits are OK.
8. Add a few “rabbits” to the “Field”, making sure that they appear in random locations.
9. Rabbits must move around the “Field”. Rabbits are brought to life using Threads.
10. Rabbits must “breed”.
11. Use various control structures to ensure that new rabbits are added to the “Field” at random times.
12. When the player clicks on rabbit, increase the score, decrease the rabbit count and delete the rabbit. Implement ActionListener to detect when the rabbit is clicked on.
13. The game ends after all rabbits are dead (or other reasonable and suitable programmed condition) or if the total number of rabbits on the screen exceeds 100 rabbits..
14. Make sure the score remains on the screen when the game ends.
15. Let the player know the game is over. You might want to ask the player if they want to play again.
16. Use the JOptionPane class to interact with the user.
17. Google is your best friend.