Code for Life
Search…
Babylon
This section describes the way Babylon is used as the game engine for Kurono.
Here we will go into some detail on how Babylon is structured within our project, and how we've chosen to organise the files.
First, we will look at the file structure for the babylon part of the game page:
1
babylon
2
β”‚
3
β”œβ”€β”€ assetPacks
4
β”‚ β”œβ”€β”€ assetPack.ts
5
β”‚ β”œβ”€β”€ future.ts
6
β”‚ β”œβ”€β”€ ...
7
β”‚ └── getAssetPackForEra.ts
8
|
9
β”œβ”€β”€ entities
10
β”‚ β”œβ”€β”€ avatarManager.test.ts
11
β”‚ β”œβ”€β”€ avatarManager.ts
12
β”‚ β”œβ”€β”€ ...
13
β”‚ └── index.ts
14
β”‚
15
β”œβ”€β”€ environment
16
β”‚ β”œβ”€β”€ index.ts
17
β”‚ β”œβ”€β”€ light.test.ts
18
β”‚ β”œβ”€β”€ light.ts
19
β”‚ β”œβ”€β”€ ...
20
β”‚ β”œβ”€β”€ environment.ts
21
β”‚ └── environmentManager.ts
22
β”‚
23
β”œβ”€β”€ animation.ts
24
β”œβ”€β”€ diff.ts
25
β”œβ”€β”€ gameEngine.ts
26
β”œβ”€β”€ ...
27
β”œβ”€β”€ interfaces.ts
28
└── orientation.ts
Copied!
interfaces.ts contains the typing (interfaces) for objects specific to our project, such as GameNode.
We split the remaining elements of the game into two folders:
  • entities: These populate the game world, and cover elements such as obstacles, avatars, and interactables.
  • environment: The elements of the game that make up the world, such as camera, light and terrain, as well as the renderer.
The files inside assetPacks handle the loading and processing different 2D and 3D assets required for each different level, or era, of the game.
All classes in these folders implement the GameNode interface. Entities also implement the DiffHandling interface.
Last modified 4mo ago
Export as PDF
Copy link