Door class and levelmanager + problem
|
So what I have started to work on this week are a Door class that will interlock with the Levelmanager. What does that mean? Well I so at first I needed to create doors that opened. Then something that I did not think about was asked of me from a graphic designer. He asked if I can do so the level changed between the different levels. I thought at first lets make it fast and easy. BUT then I ended with something that I did not think of. We have several rooms and a corridor that leads into several rooms. SO as confusing as this sound to you right now, it was to me to get the code I already have. I ended up with having to recalculate some things. So here is my solution and I have not yet managed to create the complete class as I write this but I have to write a blog now because of deadlines and this is why I hate blog deadlines. So what I am making is a Door class that takes in the value from the levelmanager before like this:
Were the lazy me re-use one of the former pictures from before, but it fits my purpose. Okay so the data this time will be. Tile number or letter for the map then the whereabouts of the tile on the sprite sheet. then it would add if it’s a normal door or if there is a exit. The exits then will get the coordinates to load the next map and then the artists can create a door. NOW clearly I am missing something and that was the thing I realized after creating the doors. I needed the doors to open in the right directions and also spawn in the right way. What do I need in the code way are something more. So the descriptions I need for my door class are now made like this, Small explanation: the ‘t’ in the picture are a tile and it will open upwards on the map. While ‘d’ is the a door that open downwards and with the code rules above it you can make it so ‘d’ is a exit and ‘t’ is a normal door. Getting all these into the document, so yeah this sounds easy but now I need to make the map1_0.txt document bigger. It can still work and is a fast fix, but seems a little excessive. So I will ask some friends for help to see if there is a better solution. If not I will see how well it works. Other than that I have already asked for help with the collision and it will work by the end of the week so we have a successful test at Monday!
|
