-
Notifications
You must be signed in to change notification settings - Fork 1
/
Land.cpp
30 lines (25 loc) · 889 Bytes
/
Land.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Land.hpp"
#include "CONST_VARIABLE.h"
namespace APlusPlus
{
Land::Land(GameDataRef data) : _data(data)
{
sf::Sprite sprite(this->_data->assets.GetTexture("Land"));
sf::Sprite sprite2(this->_data->assets.GetTexture("Land"));
sprite.setPosition(0, this->_data->window.getSize().y - sprite.getLocalBounds().height);
sprite2.setPosition(sprite.getLocalBounds().width, this->_data->window.getSize().y - sprite2.getLocalBounds().height);
_landSprites.push_back(sprite);
_landSprites.push_back(sprite2);
}
void Land::DrawLand()
{
for(unsigned short int i = 0; i < _landSprites.size(); i++)
{
this->_data->window.draw(_landSprites.at(i));
}
}
const std::vector<sf::Sprite>& Land::GetSprites() const
{
return _landSprites;
}
}