Question: In a UNIX environment using C, develop a multiplayer pong game. The players need to be able to play with each other from different stations,

In a UNIX environment using C, develop a multiplayer pong game. The players need to be able to play with each other from different stations, hence you need to develop the project using socket programming. The general idea is as follows:

1. A server is up and running, waiting for incoming requests from other machines to assign a spot in the game. The server might also do some initialization (depending on the type of game.) But the major task of the server is to mediate communication between the players.

2. Two player clients will send a connection requests to the server. When the number of required players are met, the game starts.

3. A client process will capture key strokes from the human player, and after putting it into proper struct format, will send it to the server. Also, the client will receive incoming struct data from the server, and produce/update the corresponding visual screen.

In this game, there are two pads on the two sides of the screen, moving vertically up and down. A ball (which can be the character o) will be sent back and forth between the two pads. If the ball touches either of the pads, it will bounce back. Otherwise a score will be assigned to the winning pad. The server will work merely as a mediator, sending back and forth the message received from each client. Include comments.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!