Exemple #1
0
void Player::isDead()
{
	// Don't kill him if he's already dead
	if (dead) { return; }

	// Remember if he's dead or not
	dead = true;

	// Get the 'dead' sprite
	ResourceLoader resLoader = ResourceLoader::getInstance();

	//Stop running animation and replace the sprite png to the DEAD one
	this->getActionManager()->removeActionByTag(PLAYER_ANIMATION_RUNNING, this);
	
	// Reinitialize with 'dead' sprite
	this->initWithFile(resLoader.getImageFile(PLAYER_ANIMATION_DEAD));
}