A bit of detailed inside baseball today! How to build a new room from scratch, the way I do it!
- I look at my design docs to see what the room should be, today it's "A challenge room with rising and lowering lava and enemies to kill, the reward is some gear (GigaPyroBits)"
- If I already have the same room in a different state done, I duplicate it, clean it up of all enemies, spawn points, chests, etc.
- I change the sprites to match the correct state (so in this case I'm making the room red instead of blue)
- I create the Room242.cs file (each room is its own C# script) make it of type Room instead of MonoDevelop, change the start/update function, redefine the examine function (for the challenge terminal) and assign it to the RoomControl object present in all rooms of the game.
- I also make sure the map transitions are properly set so it warps to the right place
- In the map controller I add the data for this room (the only door is down, it's a challenge room)
- I add the challenge terminal prefab, the blocks that will turn solid when you start the challenge and the spawn points for the enemies.
- I create the challenge in the main controller. I also create a new piece of gear for that challenge. In this case, I'll give the Timelord Watch. A misc item that gives you more time for challenges.
- I check if the challenge works without the lava. It doesn't work because the frogs are spawning into the floor and it makes them twitch.
- I fix that by moving the spawn points around, then I add the lava. It's going to be a huge rectangle of fire that moves up and down and kills you if you touch it.
- The lava moves way too fast, moving 1f unit per frame makes it go up and down in two thirds of a second, so I tweak that.
- I try the challenge, it's too tough, the lava gets me every time. I tweak that. After four tries, I manage to do it in 30 seconds, so I lower the time allowed to 50 (from 60)
- I code the time bonus given by the equipped watch, then edit the save file so the challenge is uncompleted (to test if I have more time to do it)
- I test it with a few time values, when I see that it works, I mark is as done in my design doc. The room is also completed, so I mark that done as well!
Currently working on: Continuing the story
Time spent on the project so far: 323 hours
Screenshot after the jump: The result!