HTTPS SSH

Network Multiplayer Connect 4

This assignment involved using python along with the pygame library to create a simple game. The main objective of the assignment was to select 3 features of the python / pygame libraries and utilise these in a playable 2D game. I chose to focus on the threading, networking and rendering functionality exposed by python/pygame to create a networked game of the traditional Connect4 board-game. After discussing different approaches a threaded clientserver system was implemented whereby one of the players could act as the game server.

Prerequisites

Starting The Server

Windows

From the windows command line run the following commands:

  • cd %connect4_root%
  • C:\Python27\python server.py

Linux

From the linux terminal run the following command:

  • python server.py

Playing The Game

Once the server is started each player should start a client instance as follows:

Windows

From the windows command line run the following commands:

  • cd %connect4_root%
  • C:\Python27\python client.py SERVER_IP_ADDRESS

Linux

From the linux terminal run the following command:

  • python client.py SERVER_IP_ADDRESS