A collection of 2D games for a light installation at the University of Kiel, currently including:
- Snake
- Breakout
- Space Invaders
- A brick puzzle game (featured below)
Module | MVC Components | Contents |
---|---|---|
app | View, ViewController, (Model) | The main Lighthouse application. |
shared | ViewModel, (ViewController, Model) | The graphics and animation API. |
Module | MVC Components | Contents |
---|---|---|
puzzle | Model, ViewModel, ViewController, Controller | The original puzzle game. |
snake | Model, ViewModel, Controller | The classic snake game. |
breakout | Model, ViewModel, Controller | The game "Breakout". |
spaceinvaders | Model, ViewModel, Controller | The game "Space Invaders". |
New game modules are currently registered in AppViewController
.
To use the Lighthouse API, create a new file named authentication.txt
inside src/main/resources
with the following contents:
username=YOUR_USERNAME
token=YOUR_API_TOKEN
Login at https://lighthouse.uni-kiel.de/login to generate a new API token and to see the transmitted Lighthouse grid.
To connect to the Discord API, create a new file named discordToken.txt
inside src/main/resources
with the following contents:
token=YOUR_AUTHENTICATION_TOKEN
clientID=OPTIONAL_CLIENT_ID
The application implements a variant of the well-known MVC pattern. The responsibilities are as follows:
- accepts raw input events and sends them to a responder
- handle user input
Responders usually process a "higher-level" representation of user input (which is closer to the actual domain) rather than raw mouse events.
Loosely speaking, view controllers coordinate communication between UI components. They...
- assemble the subview hierarchy (by adding childs etc.)
- setup inputs, views and controllers
- observe the model and invoke the view
Note that views and/or controllers may be polymorphic (i.e. they implement an interface such as
GridView
).
- present the model
- implement a responder for associated views (they accept user input)
- contain data and domain logic
Models are completely independent from the UI code.