This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPawn | |
: public IActor | |
{ | |
public: | |
/* Konstruktor pionka. | |
*/ | |
explicit IPawn(IPawnController *controller); | |
/* Destruktor pionka. Dba o to, by kontroler został prawidłowo usunięty. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPawnController | |
{ | |
public: | |
/* Konstruktor klasy kontrolera pionka */ | |
IPawnController(); | |
/* Destruktor klasy kontrolera pionka */ | |
virtual ~IPawnController(); | |
/* Funkcja będzie uaktualniała wszystko | |
co związane z ruchem pionka. Prezentacje pionka |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Resources | |
{ | |
public: | |
Resources() | |
: m_window(new sf::RenderWindow(sf::VideoMode(800, 600, 32), "Okienko")) | |
{ | |
} | |
~Resources() | |
{ | |
if(m_window) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void draw_all(sf::RenderWindow &window, std::vector<sf::Sprite*> &sprites) | |
{ | |
for(auto *sprite : sprites) | |
window.draw(*sprite); | |
} | |
int main() | |
{ | |
sf::RenderWindow window; | |
std::vector <sf::Sprite*> gameSprites; | |
// troche kodu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sf::RenderWindow window; | |
float gameSpeed = 1.0f; | |
int main() | |
{ | |
// kod. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IActor | |
{ | |
public: | |
/* Konstruktor aktora. | |
*/ | |
inline IActor() | |
: m_rotation(0) | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////////////////////////////////// | |
CTextureManager::CTextureManager() | |
{ | |
} | |
////////////////////////////////////////////////////////////////////// | |
CTextureManager::~CTextureManager() | |
{ | |
/* Usuwamy każdą teksturę. */ | |
for (auto textureData : m_textures) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Statyczna metoda, ktora laduje teksture do pamieci i ustawia ją pod kluczem | |
podanym w [textureName]. Jeśli textura o tej nazwie już istniała, to zamieniamy ją. | |
Robimy to w taki sposób, by nie "psuć" spritów, które już korzystają z tamtej tekstury. | |
*/ | |
static sf::Texture* Load(const std::string &textureName, const std::string &texturePath); | |
/* Usuwa teksture o podanej nazwie [textureName] z pamięci. | |
*/ | |
static bool Unload(const std::string &textureName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unordered_map> | |
/* Klasa do zarządzania teksturami | |
*/ | |
class CTextureManager final | |
{ | |
public: | |
/* Typedef dla umilenia życia. */ | |
typedef std::unordered_map<std::string, sf::Texture *> TTexturesUM; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Include/Game.hpp" | |
int main() | |
{ | |
auto &game = CGame::Instance(); | |
game.Run(); | |
return 0; | |
} |