New Path, Character and other simple classes, but a renderer is missing so now nothing gets displayed anymore.
47 lines
1.7 KiB
C++
47 lines
1.7 KiB
C++
#include "game.hpp"
|
|
#include "character.hpp"
|
|
|
|
namespace cloonel {
|
|
namespace {
|
|
const char g_characterTexture[] = "resources/graphics/duck.bmp";
|
|
} //unnamed namespace
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
Game::Game (SDLMain* parSdlMain, const char* parBasePath) :
|
|
GameBase(parSdlMain, parBasePath),
|
|
m_character(new Character(m_path.GetFullPath(g_characterTexture), parSdlMain))
|
|
{
|
|
}
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
Game::~Game() noexcept {
|
|
}
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
void Game::Prepare() {
|
|
m_character->Prepare();
|
|
}
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
void Game::Destroy() noexcept {
|
|
m_character->Destroy();
|
|
}
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
void Game::OnRender() {
|
|
const int2 newPos(m_character->GetPos() + 0.5f);
|
|
//m_character->Render(newPos);
|
|
}
|
|
|
|
///------------------------------------------------------------------------
|
|
///------------------------------------------------------------------------
|
|
void Game::OnUpdate (float parDelta) {
|
|
//const float2 increase(parDelta * 15.0f, parDelta * 22.8f);
|
|
//m_pos += increase;
|
|
}
|
|
} //namespace cloonel
|