After lots of failing, finally got it uploaded to git.
Question, I'm going to change all constructors in the project to use initialization lists but I have an issue.
If the super classes constructor is as follows;
Entity::Entity(GameState *state)
:_isLoaded(false), _state(state), alive(true)
{
}
What do I do a child classes constructor? I've attempted lots of different variations but none seem to be working, this was the closest I got to expecting it too work.
Player::Player(GameState *state)
: score(0), health(100), xp(0), rank(0), bulletSpeed(600),triShot(false),rapidFire(false)
: Entity(state) : name(entityPlayer), collidable(true)
I originally had name and collidable as part of the player constructor and it errored but then was curious at, because they're part of the entity class if they should go with that? Either way nothing worked and it left me back at the beginning of the error.
SLIGHT FIX:
Player::Player(GameState *state)
: Entity(state), score(0), health(100), xp(0), rank(0), bulletSpeed(600),triShot(false),rapidFire(false),_colour(sf::Color(128,255,86,255))
{
Complies without error but I'm unable to include the boolean "collidable" or the enum "name" as they appear to error no matter where I put them, So how does one include variables that are in the superclass using initialization lists?
There's simply put no need for manual memory management in modern C++ anymore. Getting new/delete correctly done is nearly impossible and if you get more than just a few things to take care of, you've already lost. I always like to point towards Nexus' example in "Why RAII rocks!" thread (http://en.sfml-dev.org/forums/index.php?topic=9359.msg63566#msg63566).
But on topic: Yeah the codebase is quite big and nobody really wants to spend their time going through everything.
I just randomly opened some files and looked at them. If I'm not mistake I already found some memory leaks (https://github.com/ChrisMelling/basicGame/blob/master/test2/Quadtree.cpp#L28) in the Quadtree (new gets called, but delete doesn't), except if you delete the stuff outside of the class, which would be a horrible thing to do.
And another memory leak in GameObjectManager (https://github.com/ChrisMelling/basicGame/blob/master/test2/GameObjectManager.cpp#L9).
#include "SFML\System.hpp"
Two things are wrong here. 1) It should be #include <> 2) Don't EVER use \ for paths. / are supported with all compilers.
Use references over pointers.
Apply some const correctness.
And I think there's a lot more, that can get improved, but I don't want to go through the whole code. ;)