// Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2015
//
// Sewer Glue

#include		"GameOver.hpp"

#include<iostream>
void			hbs::GameOver::Display(sf::RenderTarget		&screen)
{
  static const std::string	str = "-= Game oveR =-";
  int			i;
  int			j;

  screen.clear();

  sprites[FONT].setColor(sf::Color::White);
  for (i = 0; i < (int)str.size(); ++i)
    {
      sprites[FONT].setPosition(i * 6 + (sg->GetScreenWidth() - str.size() * 6) / 2,
				(sg->GetScreenHeight() - 7) / 2);
      sprites[FONT].setTextureRect(sf::IntRect(str[i] * 5, 0, 5, 7));
      screen.draw(sprites[FONT]);
    }

  if (warping)
    for (j = 0; j < sg->GetScreenHeight(); j += 7)
      for (i = 0; i < sg->GetScreenWidth(); i += 5)
	{
	  sprites[FONT].setColor(sf::Color::Black);
	  sprites[FONT].setTextureRect(sf::IntRect(('!' - warp_animation - 1) * 5, 0, 5, 7));
	  sprites[FONT].setPosition(i, j);
	  screen.draw(sprites[FONT]);
	}

  if (arriving)
    for (j = 0; j < sg->GetScreenHeight(); j += 7)
      for (i = 0; i < sg->GetScreenWidth(); i += 5)
	{
	  sprites[FONT].setColor(sf::Color::Black);
	  sprites[FONT].setTextureRect(sf::IntRect(('!' - arriving - 1) * 5, 0, 5, 7));
	  sprites[FONT].setPosition(i, j);
	  screen.draw(sprites[FONT]);
	}
}

