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

#include		"SewerGlue.hpp"
#include		"Ingame.hpp"

bool			hbs::Ingame::Event(const sf::Event		&event)
{
  if (warping || arriving)
    return (false);
  if (event.type == sf::Event::KeyPressed || event.type == sf::Event::KeyReleased)
    {
      if (event.key.code == sf::Keyboard::Left)
	move[LEFT] = (event.type == sf::Event::KeyPressed);
      else if (event.key.code == sf::Keyboard::Right)
	move[RIGHT] = (event.type == sf::Event::KeyPressed);
      else if (event.key.code == sf::Keyboard::Up)
	move[UP] = (event.type == sf::Event::KeyPressed);
      else if (event.key.code == sf::Keyboard::Down)
	move[DOWN] = (event.type == sf::Event::KeyPressed);
      else if (event.key.code == sf::Keyboard::Space && event.type == sf::Event::KeyPressed)
	{
	  if (monster_hidden && miam == 0)
	    miam = 32;
	}
      else if (event.key.code == sf::Keyboard::Escape)
	{
	  sg->module[hbs::SewerGlue::MENU]->Reset();
	  warping = true;
	  destination = hbs::SewerGlue::MENU;
	  warp_animation = 0;
	}
      else if (event.key.code == sf::Keyboard::Return && event.type == sf::Event::KeyPressed)
	NewCar();
    }
  return (false);
}

