The Server part of the project Two Boxes with Balls. Balls are bouncing inside rectangular container boxes. This program is running on two computers. If the ball touches the right side border of the first box, it will emerge from the left side border of the second box.Used different colors for balls which run on different computers. When a ball touches the right side border, It will capture current attributes of this ball object and send this information using sockets to the ball bouncing program which is running on the second computer. This program will create a ball object with the variables received from the first computer. The ball object on the first computer should be destroyed. The first computer is the client and the second computer is the server. You can also run the client and server program on the same computer. Two programs are slightly different, the first program includes the client code and the second program includes the server code.Since the ball class includes Graphics class, we can not serialize the ball object and send it to the second computer. It should be defined as another class which holds the necessary information for a ball and create the object of this class to send ball information to the second computer.
karya55 / servergame Goto Github PK
View Code? Open in Web Editor NEWThe Server part of the project Two Boxes with Balls. Balls are bouncing inside rectangular container boxes. This program is running on two computers. If the ball touches the right side border of the first box, it will emerge from the left side border of the second box.Used different colors for balls which run on different computers. When a ball touches the right side border, It will capture current attributes of this ball object and send this information using sockets to the ball bouncing program which is running on the second computer. This program will create a ball object with the variables received from the first computer. The ball object on the first computer should be destroyed. The first computer is the client and the second computer is the server. You can also run the client and server program on the same computer. Two programs are slightly different, the first program includes the client code and the second program includes the server code.Since the ball class includes Graphics class, we can not serialize the ball object and send it to the second computer. It should be defined as another class which holds the necessary information for a ball and create the object of this class to send ball information to the second computer.