Last Signal – Room system

When coding for the Last Signal, I wanted to create an easier and faster way to create levels in the game rather than having to code each level individually. This would also allow our level designer to design the levels and test them without having to wait for us programmers generating the level and send the results back. This lead me to write what I call the Room System.

It reads in a .txt file that contains the relevant data for the particular level/room that the player is currently in. With this data the system will generate the correct type of tiles from a given tile sheet and places them in the correct position. It then reads in hitboxes for the walls of the level and places them according to the given data. Our level designer is using a very early build version of the game that shows the hitboxes of the player and the walls and therefore has the ability to test if they work correctly, saving the rest of the team time that can be spent elsewhere on the project.

A tile sheet used for the game.
A tile sheet used for the game.

The system continues to read the .txt file with data for the types of enemies and the positions they are placed in the level, the different power-ups and their positions as well as the positions and orientations for doors.

In the future the system will be able to read the starting position for the player on the level. At the moment the player starts in a fixed position that is hard-coded to match the correct position for the first and currently only level. The system will also be able to read data for various props in the level that will fill up the room and not make the levels feel so empty.

I have recently heard of a program called Tiled that can apparently ease the process of creating a level with tiles and hitboxes for walls, so that is something that I might have to look into.

This is a link to the .txt file that we are using for the first level of the game:

http://pastebin.com/fMaKrxNv

While it is not final, it does contain a layout of tiles, walls, enemies, powerups and a door.

About Anton Classon

2014  Programming