本文整理汇总了C++中Enemy::SetHealth方法的典型用法代码示例。如果您正苦于以下问题:C++ Enemy::SetHealth方法的具体用法?C++ Enemy::SetHealth怎么用?C++ Enemy::SetHealth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enemy
的用法示例。
在下文中一共展示了Enemy::SetHealth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpawnBoss
void EnemySpawner:: SpawnBoss()
{
Enemy* lEnemy;
lEnemy = dynamic_cast<Enemy*>(_Game->Spawn(new Enemy(), _Game->_Settings->EnemyBossTexture, true, nullptr));
lEnemy->SetHealth(_Game->_Settings->EnemyBossHealth);
lEnemy->SetSpeed(_Game->_Settings->EnemyBossSpeed);
lEnemy->Activate();
lEnemy->SetText("");
}
示例2: SpawnEnemy
void EnemySpawner:: SpawnEnemy()
{
Enemy* lEnemy;
if (Wave == 1)
{
lEnemy = dynamic_cast<Enemy*>(_Game->Spawn(new Enemy(), _Game->_Settings->Enemy1Texture, true, nullptr));
lEnemy->SetHealth(_Game->_Settings->Enemy1Health);
lEnemy->SetSpeed(_Game->_Settings->Enemy1Speed);
lEnemy->SetSound(_Game->_Settings->EnemyDeathSound);
}
if (Wave >= 2)
{
lEnemy = dynamic_cast<Enemy*>(_Game->Spawn(new Enemy(), _Game->_Settings->Enemy2Texture, true, nullptr));
lEnemy->SetHealth(_Game->_Settings->Enemy2Health);
lEnemy->SetSpeed(_Game->_Settings->Enemy2Speed);
lEnemy->SetSound(_Game->_Settings->EnemyDeathSound);
}
lEnemy->Activate();
}