Title: gameNet Interfaces
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- gameNet Interfaces lecture video (Time: 26:50)
- gameNet Interfaces document

- In this set of notes, we present some code sketches of the MyGame, MyGameInput, MyGameOutput, MyUserInterface, and MyMain classes. We use a chat program as an example, because it is the simplest example we can do.
- MyGameInput and MyGameOutput can have almost anything, but must implement Serializeable.
- MyGame class must extend GameNet_CoreGame and will need to implement the "process" method. The process method will receive a MyGameInput parameter and must return a MyGameOutput object. It often will need to implement Serializeable (depending on the game design). This class contains the game logic.
- MyMain - contains main and starts the whole networked game up. MyMain must extend GameCreator and provide the method createGame(). Normally you don't need to do anything here, but copy a MyMain.java from some other Networked Game.
- MyUserInterface - This class contains your user interface. This class must implement GameNet_UserInterface which requires your class to have 2 methods:
  - startUserInterface - This method is called at the very beginning and passes in the "GamePlayer" object which is used for communicating with your networked game.
  - receivedMessage - This method is called to hand of a MyGameOutput object to the user interface. Typically this object contains information that needs to be drawn to the screen.