Management
This program 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 during the one minute that the game runs for.
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 for program 1
1. Use main to initialise the GUI on the Event Dispatch Thread.
2. Create a Game class which extends JFrame. Game holds the game and the main method.
3. Create a Paddock class which extends JPanel.
4. In the GUI, instantiate a paddock add it to the game JFrame.
5. Create a Score class which extends JPanel.
6. In the GUI, instantiate a score and add it to the game JFrame.
7. Create a TimeRemaining class which extends JPanel.
8. Use a “Timer” and ActionPerformed to detect each time one second has passed (to decrease the time remaining).
9. In the GUI, instantiate a timeRemaining and add it to the game JPanel.
10. Create a Rabbit class which extends JButton. Square Rabbits are OK.
11. Add a few “rabbits” to the “paddock”, making sure that they appear in random locations.
12. Use various control structures to ensure that at least one new rabbit is added to the “paddock” every second.
13. When the player clicks on rabbit, increase the score and delete the rabbit. Implement ActionListener to detect when the rabbit is clicked on.
14. Make sure the score remains on the screen when the game ends.
15. Google is your best friend
Program 2 Requirements
This problem requires you to program a “server” process and a “client” process that communicate with each other. This is known as Inter-Process Communication (IPC).
The client process is to obtain a message from the keyboard and send that message to the server. The server is to add some text to the message and send it back to the client. The client is to display the message received from the server on the console.
The program is to loop indefinitely.
The program must be developed in Java.
The game must be developed and run in Eclipse.
You are required to submit your Java source code to the LMS.