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
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
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
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
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 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
///////////////////////////////////////////////////////////////////////// | |
IPawnController::IPawnController() | |
: m_owner(nullptr) | |
{ | |
} | |
///////////////////////////////////////////////////////////////////////// | |
IPawnController::~IPawnController() | |
{ | |
} |
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
IPawn::IPawn(IPawnController * controller) | |
: m_controller(nullptr) | |
{ | |
if (controller && controller->Possess(this)) | |
{ | |
m_controller = controller; | |
} | |
} | |
///////////////////////////////////////////////////////////////////////// | |
IPawn::~IPawn() |
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 CLevel final | |
{ | |
public: | |
/* Ułatwmy sobie życie typedefem. */ | |
typedef std::vector<IActor *> TActorsV; | |
/* Konstruktor klasy poziomu. | |
*/ | |
CLevel(); | |
/* Destruktor klasy poziomu. |
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
CLevel::CLevel() | |
{ | |
} | |
//////////////////////////////////////////////////////////////// | |
CLevel::~CLevel() | |
{ | |
/* Przy niszczeniu sceny niszczymy także aktorów. */ | |
this->Cleanup(); | |
} | |
//////////////////////////////////////////////////////////////// |