A distributed client-server 2-player arcade, F1 racing game, optionally running in one client, or independant clients.
Part-A
- A simple game splash screen, with a spinning car image.
Part-B
- A local client 2-player version of the game. Both players play on the same machine, using two control key sets. This is based on part A (splash screen to load client and server).
Part-C
- A distributed version of the client-server 2-player game. Each player has their own client, and the server is independant. This is based on part A to load the client; the server is loaded independantly. By default, the clients and server are configured to communicate via localhost, however, with minimal changes this can be changed to enable independant hosts.
B
/
---- A
\
C
To configure IntelliJ to run the client for you:
-
From the IntelliJ splash screen,
open
thePart-{x}
directory. -
Right-click the module in the project window and click 'Open module settings'.
-
Ensure the Project SDK, language level, and output path are set as expected. You may need to create a new folder named
out
under thePart-{x}
directory and select this for the compiler output. -
Select 'Modules' from the left-hand 'Project settings' menu and select the 'Sources' tab on the right.
-
Select the
src
directory and mark as 'Sources',src/test
as 'Tests', andsrc/main/resources
as 'Resources'. Click 'OK'. -
Configure a runner: 'Run' > 'Run...' or 'Edit configurations...' > set the class path to
main.java.ApplicationLauncher
(for Part C, usemain.java.client.ApplicationLauncher
)
-
Requires the server be started first.
- Compile all classes under the
server
package, then runServerLauncher.java
through a fresh terminal window. You may need to navigate to../TarmacSpeedway/Part-C/out/production/Part-C
and runjava main.java.server.ServerLauncher
. Alternatively, build and run via an IDE by creating a build configuration and pointing it at said class.
- Compile all classes under the
-
Open 2 instances of the client on the same machine.
- Compile all classes under the
client
package, then runApplicationLauncher.java
through another fresh terminal window. You may need to navigate to../TarmacSpeedway/Part-C/out/production/Part-C
and runjava main.java.client.ApplicationLauncher
. Alternatively, build and run via an IDE by creating a build configuration and pointing it at said class.
- Compile all classes under the
-
Edit the
remote
key withinPart-C/main/resources/remoteConfiguration.txt
to specify either the address of your local-network server (e.g.192.168.1.1
) or specify it aslocalhost
, for both clients. Save and exit the file. -
Each client must select a Car colour.
-
Click to start the race.
-
For Part B and C, use
W
,A
,S
,D
to maneuver your car. UseR
to reset cars to the start line. -
For Part C, use
ESC
to close both client connections.