#include <Game.hpp>
Inheritance diagram for gme::Game:
Collaboration diagram for gme::Game:Public Member Functions | |
| Game (eng::id assignedId, const std::shared_ptr< eng::IRenderer > &renderer, const std::shared_ptr< eng::IAudio > &audio, bool &showDebug, int skinIndex=0, const std::string &playerName="Player") | |
| ~Game () override=default | |
| Game (const Game &other)=delete | |
| Game & | operator= (const Game &other)=delete |
| Game (Game &&other)=delete | |
| Game & | operator= (Game &&other)=delete |
| void | update (float dt, const eng::WindowSize &size) override |
| void | event (const eng::Event &event) override |
| bool & | playMusic () |
Public Member Functions inherited from eng::AScene | |
| AScene (const id assignedId) | |
| ~AScene () override=default | |
| AScene (const AScene &other)=delete | |
| AScene (AScene &&other)=delete | |
| AScene & | operator= (const AScene &other)=delete |
| AScene & | operator= (AScene &&other)=delete |
| std::string & | getName () override |
| id | getId () const override |
| ecs::Registry & | getRegistry () override |
| void | setName (const std::string &newName) override |
| void | addSystem (std::unique_ptr< ecs::ISystem > system) override |
| void | updateSystems (const float dt) override |
Public Member Functions inherited from eng::IScene | |
| virtual | ~IScene ()=default |
Private Member Functions | |
| ecs::Entity | createPlayer (ecs::Registry ®istry) |
| std::pair< ecs::Entity, ecs::Entity > | createPipePair (ecs::Registry ®istry, float x, float gapY) const |
| void | resetGame () |
| bool | checkCircleCollision (float x1, float y1, float r1, float x2, float y2, float r2) const |
| bool | checkCircleRectCollision (float circleX, float circleY, float circleR, float rectX, float rectY, float rectW, float rectH) const |
| void | checkCollisions (ecs::Registry ®istry) |
| void | checkScore (ecs::Registry ®istry) |
| void | drawDebugRectangles (ecs::Registry ®istry) const |
Private Attributes | |
| const std::shared_ptr< eng::IRenderer > & | m_renderer |
| const std::shared_ptr< eng::IAudio > & | m_audio |
| std::unordered_map< eng::Key, bool > | m_keysPressed |
| ecs::Entity | m_playerEntity |
| ecs::Entity | m_playerNameEntity |
| ecs::Entity | m_looseText |
| ecs::Entity | m_flapSound |
| ecs::Entity | m_looseSound |
| ecs::Entity | m_scoreEntity |
| std::vector< std::pair< ecs::Entity, ecs::Entity > > | m_pipes |
| std::vector< bool > | m_pipeScored |
| bool & | m_showDebug |
| bool | m_playMusic = false |
| bool | m_gameOver = false |
| bool | m_gameOverShown = false |
| int | m_score = 0 |
| int | m_skinIndex |
| std::string | m_playerName |
Additional Inherited Members | |
Protected Attributes inherited from eng::AScene | |
| utl::EventBus & | m_eventBus = utl::EventBus::getInstance() |
| std::uint32_t | m_eventComponentId = 0 |
| gme::Game::Game | ( | eng::id | assignedId, |
| const std::shared_ptr< eng::IRenderer > & | renderer, | ||
| const std::shared_ptr< eng::IAudio > & | audio, | ||
| bool & | showDebug, | ||
| int | skinIndex = 0, | ||
| const std::string & | playerName = "Player" ) |
Definition at line 42 of file game.cpp.
References eng::Color::a, eng::Color::b, createPipePair(), createPlayer(), utl::Config::Color::CYAN_ELECTRIC, utl::Path::Font::FONTS_RTYPE, eng::Color::g, eng::IRenderer::getWindowSize(), ecs::IComponent::id, m_flapSound, m_looseSound, m_looseText, m_pipes, m_pipeScored, m_playerEntity, m_playerName, m_playerNameEntity, m_renderer, m_scoreEntity, eng::Color::r, ecs::Scale::x, ecs::Transform::x, and ecs::Transform::y.
Here is the call graph for this function:
|
overridedefault |
|
delete |
|
delete |
|
private |
|
private |
|
private |
Definition at line 426 of file game.cpp.
References ecs::Registry::getComponent(), ecs::Transform::x, and ecs::Transform::y.
Here is the call graph for this function:
|
private |
Definition at line 475 of file game.cpp.
References ecs::Registry::getComponent(), and ecs::Transform::x.
Here is the call graph for this function:
|
private |
Definition at line 319 of file game.cpp.
References ecs::Registry::createEntity(), and ecs::Registry::EntityBuilder::with().
Referenced by Game().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 303 of file game.cpp.
References utl::calculateHitboxOffsets(), ecs::Registry::createEntity(), utl::GameConfig::Player::SCALE, utl::GameConfig::Player::SPRITE_HEIGHT, utl::GameConfig::Player::SPRITE_WIDTH, utl::Path::Texture::TEXTURE_PLAYER, and ecs::Registry::EntityBuilder::with().
Referenced by Game().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 513 of file game.cpp.
References ecs::Registry::getComponent(), eng::Color::r, ecs::Transform::x, and ecs::Transform::y.
Here is the call graph for this function:
|
overridevirtual |
Implements eng::IScene.
Definition at line 278 of file game.cpp.
References eng::Event::key, eng::KeyPressed, ecs::Audio::play, eng::R, eng::Space, and eng::Event::type.
|
inline |
Definition at line 37 of file Game.hpp.
References m_playMusic.
|
private |
Definition at line 354 of file game.cpp.
References getGapSize(), randomPipeType(), and ecs::Transform::x.
Here is the call graph for this function:
|
overridevirtual |
Implements eng::IScene.
Definition at line 178 of file game.cpp.
References getGapSize(), eng::WindowSize::height, randomPipeType(), eng::WindowSize::width, ecs::Transform::x, ecs::Velocity::x, ecs::Transform::y, and ecs::Velocity::y.
Here is the call graph for this function:
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 61 of file Game.hpp.
Referenced by playMusic().
|
private |
|
private |