Game Development Process Week 7

Hello everybody!

This week I am going to talk about the refinement of the way that we construct levels in our game. Two weeks ago in the fifth week of the development process I showed you the approach that I used to create the level and now that method has been refined. 

First, we start with a look back at how I did it before. We use text documents to read in a sprite sheet and then we assign each tile in the sprite sheet with a number or letter. Then we tell the program which cordinates each tile has in the sprite sheet. After that we decide if the player should be able to walk on the tile or if it is a wall that can not be walked on.

../data/Maps/Floor_SpriteSheet.png
22 128 128
1 129 0 1

The first row is where the sprite sheet is located in the game folder. The second row tells the program how many tiles there is in the sprite sheet and how big they are. And the last row is the assigned letter or number in this case, the following numbers are the coordinates that the tile has in the sprite sheet and the last number tells the program if the tile is walkable or not.

Now we have expanded the data that we tell the program about the tiles so that right now it looks like this in the textfiles.

../data/Maps/Floor_SpriteSheet.png
27 128 128
l 0 387 0 null 0 0
m 0 516 7 left 2 0

The first two rows are like it was last time with the path to the sprite sheet and number of tiles and the size of them.

The next lines has changed somewhat though. At first we assign a letter or number and tell the program the coordinates of the tile like last time. But the number that follows don’t just tell the program if the tile is walkable or not but also if the tile is a door or not. If the tile is not a door then the two last columns don’t matter and therefor it just says null and 0 0. But if it is a door, like the number 7 tells the program that it is, the following columns i important. The “left” means that the door sprite that automatically spawns on tiles that are assigned as doors will be moving left as the player gets near the door and wants to go through.

And the last two digits tell the door to which level it should send the player. The layout of the spaceship is designed as rooms and the rooms are named as 1.1 to 7.1 so in this case it means that the door slides left and opens textfile 2.0 and then spawns the player in that room.

In the picture below you can see how the doors are being placed on top of the door assigned tiles.

screenshot 4

That was all the info I had this week. Take care and I see you next week!

About Håkan Pettersson

2014  Graphics