Exemple #1
0
/* Waits however many seconds passed in */
void Enemy::WaitToShoot (bool shootSmart, int seconds, BulletManager * bulletManager, Player * player )
{
	float velocityX = 0;
	float velocityY = 1;
	
	if (shootSmart){
		velocityX = atan(player->GetPosition().x - position.x);
		velocityY = atan(player->GetPosition().y - position.y);
		}
	
	  if(update == true)
	  {
		endwait = timer + seconds;
		update = false;
	  }
	  if (timer < endwait) 
	  {
			// if timer has not been reached	
			timer++;
	  }
	  else
	  {
		// if timer has been reached
		bulletManager->CreateBullet(2, position.x, position.y, velocityX * GetAgi(), velocityY * GetAgi());   // agi changes the bullet speed
		update = true;
		timer = 0;
	}
}
Exemple #2
0
void Game_Battler::UpdateGauge(int multiplier) {
	if (IsDead()) {
		return;
	}

	if (gauge > EASYRPG_GAUGE_MAX_VALUE) {
		return;
	}
	gauge += GetAgi() * multiplier;

	//printf("%s: %.2f\n", GetName().c_str(), ((float)gauge / EASYRPG_GAUGE_MAX_VALUE) * 100);
}