Build the level

Create the project

  1. In the Project Hub, select New Project..., enter CoinCollector as the Name and select Create.
  2. Open CMakeLists.txt in the project folder and add these lines at the end:
CMakeLists.txt
# the packages this game calls into: physics for the player and the coins,
# audio for the pickup sound
target_link_libraries(CoinCollector PRIVATE Shalltear::Physics3D Shalltear::Audio)

The game uses two of the engine's packages: Physics 3D moves the player and notices the coins, and Audio plays the pickup sound. A new project has both turned on, but your code can call a package only once CMakeLists.txt links it. The editor compiles again when you save the file.

A scene for the first level

  1. Select File ▸ New Scene. The new scene has a camera and a light.
  2. Press Ctrl+S. The scene has never been saved, so the editor asks for a path. Change Untitled to Level1 so it reads project://Assets/Scenes/Level1.scene, and select OK.

The floor and the walls

  1. In the Hierarchy, select + and choose 3D Object ▸ Cube. Press F2 and rename it Floor.
  2. In the Inspector, set Position to 0, -0.5, 0 and Scale to 20, 1, 20.
  3. Select Add Component, type BoxCollider and select it. A collider gives an object a shape that physics can collide with, and a box collider fits a cube of any scale.
  4. Make the four walls the same way. Each is a Cube with a BoxCollider. Select a wall and press Ctrl+D to duplicate it rather than start again.
NamePositionScale
Wall North0, 1, 10.522, 2, 1
Wall South0, 1, -10.522, 2, 1
Wall East10.5, 1, 01, 2, 20
Wall West-10.5, 1, 01, 2, 20

Colors

  1. In the Asset Browser, select + and choose Create ▸ Material. Press F2, rename it Ground.mat and select OK.
  2. In the Inspector, set baseColor to a gray and select Save.
  3. Select the floor, and drag Ground.mat from the Asset Browser onto Material 0 in its MeshRenderer. Do the same for each wall.
  4. Make two more materials the same way for the next pages: Gold.mat in yellow and Player.mat in blue.

The camera

Select Main Camera and set Position to 0, 16, -14 and Rotation to 50, 0, 0. It now looks down at the arena from one end. The Runtime View shows what it sees.

Press Ctrl+S to save. Next, make a coin.