|
@@ -51,13 +51,13 @@ A detailed description of all files of the example game can be found below:
|
|
|
### Backend
|
|
|
The backend code under `res/scripts` contains the game loop which simulates the model. The game loop is written in [ECAL](https://github.com/krotik/ecal) and runs inside the EliasDB process.
|
|
|
|
|
|
-File|Description
|
|
|
--|-
|
|
|
-const.ecal|Definition of object kinds and errors.
|
|
|
-engine.ecal|The GameEngine object which contains the code for the game loop.
|
|
|
-helper.ecal|General helper functions.
|
|
|
-main.ecal|All sink definitions. These are used for all data entry point via the web interface and for the game loop.
|
|
|
-templates.ecal|Contains implementation of all model objects classes which will be simulated by the game loop.
|
|
|
+| File | Description |
|
|
|
+| --- | --- |
|
|
|
+| const.ecal | Definition of object kinds and errors. |
|
|
|
+| engine.ecal | The GameEngine object which contains the code for the game loop. |
|
|
|
+| helper.ecal | General helper functions. |
|
|
|
+| main.ecal | All sink definitions. These are used for all data entry point via the web interface and for the game loop. |
|
|
|
+| templates.ecal | Contains implementation of all model objects classes which will be simulated by the game loop. |
|
|
|
|
|
|
### Frontend
|
|
|
The frontend code under `res/frontend` contains the display loop written in TypeScript. It can be build easily using `npm` with:
|
|
@@ -66,29 +66,31 @@ $> npm -i
|
|
|
$> npm run build
|
|
|
```
|
|
|
|
|
|
-File|Description
|
|
|
--|-
|
|
|
-frontend.ts|Provides the entry start() function. Here we mainly create objects and put them together. After registering the game world, creating a websocket for backend communication and registering the actual player the game is started once the first update is received through the websocket.
|
|
|
-helper.js|General helper functions.
|
|
|
+| File | Description |
|
|
|
+| --- | --- |
|
|
|
+| frontend.ts | Provides the entry start() function. Here we mainly create objects and put them together. After registering the game world, creating a websocket for backend communication and registering the actual player the game is started once the first update is received through the websocket. |
|
|
|
+| helper.js | General helper functions. |
|
|
|
|
|
|
#### backend/
|
|
|
-File|Description
|
|
|
--|-
|
|
|
-api-helpers.ts|Library to send requests to the ECAL backend via normal HTTP requests and websockets.
|
|
|
-asset-loader.ts|Loader object to preload game assets such as images and sounds.
|
|
|
-eliasdb-graphql.ts|GraphQL client library for EliasDB. This library supports subscriptions.
|
|
|
-types.ts|Interface definitions for backend data structures.
|
|
|
+
|
|
|
+| File | Description |
|
|
|
+| --- | --- |
|
|
|
+| api-helpers.ts | Library to send requests to the ECAL backend via normal HTTP requests and websockets. |
|
|
|
+| asset-loader.ts | Loader object to preload game assets such as images and sounds. |
|
|
|
+| eliasdb-graphql.ts | GraphQL client library for EliasDB. This library supports subscriptions. |
|
|
|
+| types.ts | Interface definitions for backend data structures. |
|
|
|
|
|
|
#### display/
|
|
|
-File|Description
|
|
|
--|-
|
|
|
-default.ts|Abstract classes which implement some functionality of the display related interface definitions.
|
|
|
-engine.ts|MainDisplayController - Object containing the draw loop which visualises the current state of the game model.
|
|
|
-types.ts|Display related interface definitions.
|
|
|
+
|
|
|
+| File | Description |
|
|
|
+| --- | --- |
|
|
|
+| default.ts | Abstract classes which implement some functionality of the display related interface definitions. |
|
|
|
+| engine.ts | MainDisplayController - Object containing the draw loop which visualises the current state of the game model. |
|
|
|
+| types.ts | Display related interface definitions. |
|
|
|
|
|
|
#### game/
|
|
|
-File|Description
|
|
|
--|-
|
|
|
-game-controller.ts| MainGameController - Contains only a communication handler to handle messages from the actual game controller in the backend.
|
|
|
-lib.ts|Game related library functions and objects.
|
|
|
-objects.ts|Implementation of game objects.
|
|
|
+| File | Description |
|
|
|
+| --- | --- |
|
|
|
+| game-controller.ts | MainGameController - Contains only a communication handler to handle messages from the actual game controller in the backend. |
|
|
|
+| lib.ts | Game related library functions and objects. |
|
|
|
+| objects.ts | Implementation of game objects. |
|