Individual Assignment

Hi group 7!

First things first, If I’m not mistaken since I can’t see it but it can be me being blind. You are not using any kind of managers to handle events in the Player.cpp class. I strongly recommend using managers since you never need to re-write code everywhere and can instead re-use code from the manager just by pointing to it. Which is a lot quicker and more efficient to do than to completely re-write everything all the time. This removes unnecessary code and creates a more structured feel to the whole project. It also decreases the chance for errors!

I also recommend using SFML implemented functions as Move as an example. Move makes it a lot easier to manage the movement of objects or sprites, since you don’t have to write your own movement. Since it’s an implemented function in SFML you can use it automatically in all classes. Which yet again makes coding more efficient and structured, which in itself isn’t completely necessary, but I still strongly recommend it.

Using bounding boxes is something that is really good. It’s easy to manage since due to the simplicity of the function since it’s short and memorable and also already implemented in SFML. You can also quickly make the box smaller or bigger as well as changing where it’s located by using other already implemented SFML functions. In th end it’s a really effective use of a hitbox due to several reasons I’ve stated above.

The overall structure of the code seems like it’s quite well done apart from what is stated above. You use a ton of different written functions for all of your unique entities that are defined in the Player.cpp which is really good.

You’re also not implementing everything into main.cpp directly which is nice. Coding directly in main.cpp is incredibly lazy and I advise you to keep on not doing it. Good code structure is actually important when the projects starts to get big, since it’s easier to navigate and find where everything is located. Which is almost impossible if everything is located in the main.cpp, since there would be so many lines of code that it would be practically impossible without directly using the search function and searcing for exactly what you’re looking for.

Take all of this with a grain of salt, I’m in no way an experienced programmer, but this is my first impressions of your player class.

About Alfons Warg

2015 Programming