Creating levels

This article is intended for those who have minimal knowledge of the principles of the Godot engine.

To create a level you need the engine and the game sources, opened in the engine (see points 1-5 in the article about building the game). Use already created levels as examples (see res://Scenes/Levels/). Don’t forget to save your progress. When arranging objects, prefer round numbers in positions.

Preparation

  1. Inherit or copy the contents from the res://Scenes/Levels/BasicSingleplayerLevel.tscn or res://Scenes/Levels/BasicMultilayerLevel.tscn (depending on the level’s play mode) scene to the new scene;
  2. Remove the editor description in the root node (BasicLevel);
  3. Rename the root node (BasicLevel) to the name of your level. It is recommended to use PascalCase in node naming;

For the singleplayer mode:

In the root node properties (BasicLevel), specify the level number and the next level.

Save the level file separately from the project, loading will be done via the Load button in the Play menu.

For the multiplayer mode:

Add the following constant to the res://Scripts/Utilities/MultiplayerManager.gd script:

const LEVEL_NAME: Dictionary = {
	"max_players": number,
	"spawn_positions": [Vector2(x, y), Vector2(x, y) ... ],
	"used_spawn_positions": [],
	}

And replace number with the maximum number of players. Also write the players’ spawn points by changing x and y.

Also add your level to the list by changing the LEVELS constant:

const LEVELS: Dictionary = {
	...
	"LevelFileName": LEVEL_NAME,
	}

Creating an environment

  1. Create the walls and floors of the level in the BlocksTileMap tile map. Recommendations:
    • Compose the tiles so that the line on them is on the player’s side;
    • Create floors under the guides;
  2. Create a background in the EnvironmentTileMap tile map. Recommendations (the tile numbers correspond to the file names (starting from zero) in res://Sprites/Environment/ and the order in the tileset):
    • Use the first tile for the outdoor floor;
    • Use the second tile for the background walls inside the room;
    • Use the third tile for transitions from indoors to outdoors;
    • Use the fourth tile for floor separations;
    • Use the fifth tile for something unusual, such as secret rooms;
    • Use the sixth tile for where the level starts (the player’s spawn point);
    • Use the seventh tile in front of enemy spawners or other unexpected hazards;
    • Use the eighth tile for the background walls of a room with a portal to the next level;

Adding light

Select the type of light (0 - general, 1 - directional) and make the scene instance res://Scenes/Lamps/Lamp + type.tscn in /Lamps/type/. Change the Texture Scale if necessary, don’t forget to fix the Offset when using directional light.

Adding items

To add an item, select the desired type (Gun, MedChest or BulletsPack) make the scene instance res://Scenes/Items/type.tscn to /type + s/ and change the properties.

General properties of items:

Properties Guns:

MedChest properties:

Properties BulletsPack:

Customizing enemies (singleplayer mode only)

Select the enemy type (0 to 2), make the scene instance res://Scenes/Enemies/Enemy + type.tscn to /Enemies/type/ and change the properties.

Enemy Properties:

Customizing enemy spawners (singleplayer mode only)

Make the scene instance res://Scenes/Items/EnemySpawner.tscn into /EnemySpawners/ and change the properties.

EnemySpawner properties: