Deadline: 13/6.
What to submit: For both of the following exercises you are expected to submit a WAR file that can be placed in the webapps folder of Tomcat and run automatically. Inside the file you should also include your source code.
For this exercise you are allowed (and expected) to re-use your code for Paint. Alternatively, you can use the code posted on the class web page.
The objective of this exercise is to create a cooperative drawing application. You will program a web site on which more than one users may connect simultaneously. All connected users will see an interface similar to that of the drawing program of previous homeworks. The difference is that the picture being edited will be shared, that is, any change made by one user must become automatically visible to the others.
To achieve this you need to program both a server-side and a client-side application. The two will communicate asychronously to periodically update the shown picture for each user.
Requirements:
Advice: you already have a version of the drawing program that can "understand" a drawing's description in an XML format. It will therefore be easier to program the server side to periodically send the description of the current image to the client using this XML format.
For this exercise you need to develop a web version of the Pong game you have already written in javascript. You must now build a server-side app to which users can connect and play online. Each connected user can decide which of the two paddles to control. Play is to be done using the left and right arrow keys.
Advice: you have already programmed a version of Pong. Probably, you are storing the game state (positions of paddles, ball speed and position, etc.) in some large global object. The state of this object must now be moved to the server side. The client will then communicate with the server periodically to receive updates on the current state.
Advice2: You will probably need to program the server side to periodically advance the game state. In javascript we achieve this with the setInterval function. In Java, the standard way to do this is to use the Timer class.