I have written a simple, working tetris game with each block as an instance of a class singleblock.
class SingleBlock
{
public:
SingleBlock(int, int)
Although it's possible that your runtime doesn't report this error, using a proper error-checking runtime such as Valgrind will alert you to the use of memory after it has been freed.
I recommend that if you write code with new
/delete
and raw pointers (rather than std::make_shared()
and similar), that you exercise your unit tests under Valgrind to at least have a chance of spotting such errors.