Last blogpost for Mole Munch – Fixing syntax in code

Hello! We’ve now reached the final blogpost for our Mole Munch project. Our beta presentation went well, but as a group, we didn’t feel like we wanted to add a lot more things to our game. Some adjustments were decided to be made, especially on the coding side, but most art will remain intact. The reasoning for this decision was that we all wanted to focus on our project reports. But we also felt a bit fed up with Mole Munch by now. We’ve been reworking things on it from time to time, and it felt like it’s time to finally move on.

Since we didn’t really feel like adding a lot more things, there isn’t any artifact that can be written about this week. Instead, I’ll be writing about what I did, which was looking through all the code to make sure that the Syntax looks good and that every function/method/variable has a reasonable and well-describing name. This so that a function handling player movement isn’t called something like ”X” or ”Whatever”. Since it was three of us who wrote code (three programmers), the code looked different depending on who had written it. Therefore, a challenge with fixing the code was to make it still look like everyone had written code. I didn’t want to make the code look like it was written by one person. As of the writing of this post, the code is not finished, but it’s starting to look better and better.

The syntax also matters since we’ll be handing in the source code for the Spelprogrammering II course. Therefore, I took it on me to look through the entire source code so that it all looks good codewise. This is for readability in code, but also because the syntax for writing code should follow a certain pattern. Below is a picture made to illustrate the difference between good syntax and bad syntax (the picture is made by me, therefore there might be some small errors in the syntax, but it should be relatively correct). For exact way to write syntax, look up a site like http://www.cplusplus.com/ or similar.

Apart from rewriting code, there wasn’t a lot else that could be done since we decided that we didn’t want to continue developing the game. So this was my blogpost for this week! It wasn’t really about an artifact I worked on, unless you want to consider the entire code an artifact in itself. But this is what I did this week, apart from working on my project report. Thanks for me!