Ejemplo n.º 1
0
void init(){
  _backgroundImage.LoadFromFile("assets/wood-puzzle-floor.png");
  _backgroundSprite.SetImage(_backgroundImage);
  
  _robotImage.LoadFromFile("assets/roomba.png");
  _robotSprite.SetImage(_robotImage);
  _robotSprite.SetCenter(_robotSprite.GetSize().x/2, _robotSprite.GetSize().y/2);
  _fakeRobotSprite.SetImage(_robotImage);
  _fakeRobotSprite.SetCenter(_fakeRobotSprite.GetSize().x/2, _fakeRobotSprite.GetSize().y/2);
  _fakeRobotSprite.SetColor(sf::Color(100,100,255));

  _landmarkImage.LoadFromFile("assets/landmark.png");
  _landmarkSprite.SetImage(_landmarkImage);
  _landmarkSprite.SetCenter(_landmarkSprite.GetSize().x/2, _landmarkSprite.GetSize().y/2);

  _rangeImage.LoadFromFile("assets/range.png");
  _rangeSprite.SetImage(_rangeImage);
  original_range_sprite_size_x = _rangeSprite.GetSize().x;
  original_range_sprite_size_y = _rangeSprite.GetSize().y;
  updateRangeSpriteScale();
  _rangeSprite.SetCenter((original_range_sprite_size_x/2), (original_range_sprite_size_y/2));

  _window.Create(sf::VideoMode(window_width,window_height,32), "Bearing simulator");

  move_amount = 0;
  rotation_amount = 0;
  time_to_capture = false;
  
  walk = 0;
  rotation = 0;
}
Ejemplo n.º 2
0
cHero::cHero(sf::Sprite & rHeroSprite)
{
    rHeroSprite.SetSubRect(sf::IntRect(4, 4, 67, 67));
    rHeroSprite.SetCenter(0, 64);
    rHeroSprite.SetX(600);
    rHeroSprite.SetY(762);
    setWidth(64);
    setHeight(64);
}