Game::~Game(){ if(this->currentState != nullptr){ this->currentState->unload(); } destroyStates(); if(this->audioHandler != nullptr){ delete this->audioHandler; } if(this->inputHandler != nullptr){ delete this->inputHandler; } if(this->resourceManager != nullptr){ delete this->resourceManager; } if(this->fadeScreen != nullptr){ delete this->fadeScreen; } if(this->window != nullptr){ delete this->window; this->window = nullptr; } }
Boss::~Boss(){ if(this->animation != nullptr){ delete this->animation; this->animation = nullptr; } if(this->powerAnimation != nullptr){ delete this->powerAnimation; this->powerAnimation = nullptr; } if(this->shieldAnimation != nullptr){ delete this->shieldAnimation; this->shieldAnimation = nullptr; } if(this->currentState != nullptr){ this->currentState->exit(); } this->player = nullptr; destroyStates(); }