Пример #1
0
void GiantSlimeEntity::render(sf::RenderTarget* app)
{
  if (!isDying)
  {
    // shadow
    sprite.setPosition(x, y);
    if (isMirroring)
      sprite.setTextureRect(sf::IntRect(shadowFrame * width + width, 0, -width, height));
    else
      sprite.setTextureRect(sf::IntRect(shadowFrame * width, 0, width, height));
    app->draw(sprite);
  }
  sprite.setPosition(x, y - h);
  if (isMirroring)
      sprite.setTextureRect(sf::IntRect(frame * width + width, 0, -width, height));
    else
      sprite.setTextureRect(sf::IntRect(frame * width, 0, width, height));
  app->draw(sprite);

  renderLifeBar(app, tools::getLabel("enemy_giant_slime"));

  if (game().getShowLogical())
  {
    displayBoundingBox(app);
    displayCenterAndZ(app);
  }
}
Пример #2
0
void KingRatEntity::render(sf::RenderTarget* app)
{
  EnemyEntity::render(app);

  if (state == 6)
  {
    int r = ((int)(age *12.0f)) % 2;
    if (r == 0)
      sprite.setTextureRect(sf::IntRect(1 * width, 1 * height,  width,  height));
    else
      sprite.setTextureRect(sf::IntRect(2 * width, 1 * height,  -width,  height));

    sprite.setPosition(x, y);
    sprite.setColor(sf::Color(255, 255, 255, 190));
    app->draw(sprite);
    sprite.setColor(sf::Color(255, 255, 255, 255));
  }

  renderLifeBar(app, tools::getLabel("enemy_rat_king"));
}
Пример #3
0
void CyclopsEntity::render(sf::RenderTarget* app)
{
  // shadow
  sprite.setPosition(x, y);
  sprite.setTextureRect(sf::IntRect(8 * width, 0, width, height));
  app->draw(sprite);
  sprite.setPosition(x, y);

  EnemyEntity::render(app);

  // stones
  if (state == 1 && timer < 0.5f)
  {
    if (nextRockMissile == 0) // small rock
    {
      sprite.setTextureRect(sf::IntRect(1152, 0,  64,  64));
      if (isMirroring)
        sprite.setPosition(x + 60, y + 45);
      else
        sprite.setPosition(x + 4, y + 45);
    }
    else // medium rock
    {
      sprite.setTextureRect(sf::IntRect(1152, 64,  64,  64));
      if (isMirroring)
        sprite.setPosition(x + 60, y + 33);
      else
        sprite.setPosition(x + 4, y + 33);
    }

    app->draw(sprite);
    sprite.setPosition(x, y);
  }

  renderLifeBar(app, tools::getLabel("enemy_cyclops"));
}
Пример #4
0
	void Enemy::render()
	{
		renderShadow();
		kuma_.render();
		renderLifeBar();
	}