Title: Quick Click - Threaded game
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- Quick Click - Threaded game lecture video (Time: 26:00)
- Quick Click - Threaded game document

- In this game we start out with 20 disks bouncing around within your window. When a user clicks on a disk, he gets a point and the disk goes away. Once all of the disks have been clicked, we can see who clicked on the most disks. Then a "Restart" button can be clicked to start up a new game. This is the first example where we have objects moving on their own.
- In this game we can have any number of players. Players can join or leave the game whenever they wish.
- This program uses "generic coordinates" to allow users to have different sizes of screens.
- If your networked game will have things moving around on their own, Quick Click will show you how this can be done:
  - You will need to override the startGame method in GameNet_CoreGame in order to obtain your GameControl object and start any threads needed by your game.
  - Your overall MyGame class will likely implement Serializeable, but GameControl needs to be marked as "transient" which means that it shouldn't be sent across the network.
  - Your MyGame probably then needs to implement Runnable to provide a running thread. This thread can be the logic that can for example move "bouncing disks" around.
  - The GameControl method putMsgs can be called to send MyGameOutput objects to the user interface as needed.