The topic winning the vote in class on March 27th was a distributed tetris game, likely in teams with one team’s wins causing setbacks for the other team. Additional details will be placed here as the project is further defined.
Both MP9 and Project check-off have some points for your code working properly and some for you interacting with other students’ code as a user to produce the user input that lets us test the distributed app.
Tetris is played on a 10-by-20 grid. Each cell of the grid has one of 8 states: empty, or the color/image of a piece of one of the seven tetrominos. Events occur when the player provides and action1 There are traditionally six actions: move left, move right, rotate left, rotate right, descend, drop. or on a predictable time scale (via some kind if ticking clock). The front-end could be as simple as the following:
This simple design would leave all game state to the server.
Then MP10 could be a standard tetris game. The project would add the interaction between boards and possibly some kind of validation of other server’s decisions to prevent cheating.
Should there be:
Option 1 is easy to code (no sessions to track), but means clock ticks should happen on the server side so that multiple users don’t make the clock tick faster. If clocks are on the server, the clients needs a way to know when a tick happened; maybe a WebSocket?
Options 2 and 3 presume some form of user session tracking. Perhaps a login client-to-server message to create a session ID, or having the server put such an ID into the HTML page it serves?