Design Model

These are the main classes present in the system. They are responsible for the game itself, its dynamics and playability.

The Model-View-Controller pattern is implemented, as it allows greater independence between the parts, leading to more flexibility. The Space class is responsible for calculating the new positions of every UFO that it contains, thus being the Model. UFO is an abstract class which represents any game object that exists in Space, having the position and direction of the object. It is a part of the Model. Ship is a class that extends UFO and represents a player´s ship within space. It contains also references for any missiles fired by this ship (for contability issues), this ship´s energy and other player-relative preferences.

The Player class is in charge of storing information about the player, like number of lives and points. It also processes user commands which changes this player´s Ship direction, fires missiles and accelerates. The Player objects of the many on-line players will be the Controllers.

The Viewport creates the screen that a user will see. It collects information from the Space as it sees fit and displays it to the player. The users Viewports will be the Views.