Would it be possible to use static variable in order to count how many towers are left? This is how I would see it:
- in Tower.h we add static varibale int32 called “counter” initialized to 0
- in Tower.cpp in the constructor we add a line of code which is incrementing that variable by 1
- in Tower.cpp in the destructor we add a line of code which in decrementing that variable by 1
- in Tower.cpp Tick (called every frame) function or GameMode.cpp in HandleHameStart() function we would add code that is checking if our static variable is <= 0, if yes then GameOver(true) would be called
Wonder if that is possible and what are pros and cons of that solution in comparison to the one presented in the course.