Blogpost no. 1: Spaceshooter
|
Hi all! This is the first blogpost since we started this new project I am going to explain real quick what the project is about. We picked a game called Fancy Mansion which is a game where you are playing a thief inside a fancy mansion and the goal is to steal a lot of the valueable items inside of it. One of the artifacts I have been working on this week is the walls-class. Since we have multiple different kinds of walls (read: multiple different colours on the walls) we decided to create a class for them instead of just create it hard-coded in the state where walls will be, which is called PlayState. I started of by creating the walls in the PlayState-class. We started to write the same code multiple times which is just plain stupid. It was here we decided to create the wall-class and it was enough with a few lines of code to get the same result. But the result was faster and we got a nicer code structure. A nice code structure is almost one of the most important features when writing software, because if something goes wrong it is extremely hard to debug if the code is unreadable. The wall-class was not especially hard to make, but it made difference in the development of the game. After that we could just call the class in our PlayState-class and in our map-textfile we could write the number of the entity that was the specific wall we wanted. In the picture below I will show you the collision that was created, and it is the same collision against every wall even though I am only showing you one example of the collision. You can see the collision since the old man on the left side is wanting to catch the guy to the right.
Until next time: Have a good one! / Alex |
