J323, email: firstname.lastname@example.org
RoboRace (Part 4)
In this assignment we are going to add some sounds and music to the program, and our game will go online.
Sounds & music
In this assignment your are supposed to play some sounds while executing certain GameEvents
(BumpEvent, DestroyedEvent, VictoryEvent). No modification, i.e., sound filter, is needed.
In addition, during the game you have to play a midi-file provided below. You may use the SoundManager
and the MidiManager provided in the COSC3P40 package, of course.
Notice that you should use the methods setSoundPath(...) and
setMidiPath(...) of the managers at the beginning of your program.
In the previous two assignments communication between the players
and the GameMaster
class was done by using a bidirectional
queue. In this
assignment you must replace this queue by suitable classes
establishing a connection via the
internet. Since the information transmitted is text you
have to use appropriate
Reader and Writer
objects. In order to indicate the end of a message you should use a
special character symbol, e.g.,
Provide one program that acts as the server. This program should do
- It asks for the number n
- It accepts the given number
of player, i.e., it waits for n
clients to establish a connection to the server.
- Receives name of each Player.
- It runs the GameMaster .
- After the game it shuts down all connections and then terminates.
Another program should act as a client. This program should do
- It asks for the
- It connects to the server.
- It runs a Player.
- After the game it
disconnects and then
- Use "localhost" whenever an
IP address is required so that the clients and the server may run
together on a single computer.
- You find a project folder to start here.
COSC Home Page
M. Winter, 2018