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

#include		"Ingame.hpp"

bool			hbs::Ingame::Start(hbs::SewerGlue		&_sg)
{
  int			i;

  sg = &_sg;
  for (i = FIRST_RESSOURCE; i < LAST_RESSOURCE; ++i)
    if (ressources[i].loadFromFile(ressources_file[i]) == false)
      return (false);

  background.setTexture(ressources[BACKGROUND]);
  middleground.setTexture(ressources[MIDDLEGROUND]);
  foreground.setTexture(ressources[FOREGROUND]);

  backmonster.setTexture(ressources[BACKMONSTER]);
  foremonster.setTexture(ressources[FOREMONSTER]);
  backmonster_hidden.setTexture(ressources[BACKMONSTER_HIDDEN]);
  foremonster_hidden.setTexture(ressources[FOREMONSTER_HIDDEN]);
  monster.setTexture(ressources[MONSTER]);
  monster.setTextureRect(sf::IntRect(0, 0, 15, 15));

  monster.setOrigin(monster.getGlobalBounds().width / 2, monster.getGlobalBounds().height / 2);

  lifebar.setTexture(ressources[LIFEBAR]);
  lifebar.setPosition(5, 5);

  font.setTexture(ressources[FONT]);

  Reset();
  return (true);
}

