Add some (badly) generated platforms that will scroll

down whenever the player's top side depasses the middle
of the screen.
WiP.
This commit is contained in:
King_DuckZ 2014-07-05 20:33:16 +02:00
parent 976d34f17e
commit 4a3a0a4782
13 changed files with 251 additions and 55 deletions

View file

@ -25,8 +25,8 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
Platform::Platform (SDLMain* parSdlMain, const float2& parPos, Texture* parTexture, const float2& parSize) :
Placeable(parPos),
m_screenRatio(parSdlMain),
m_position(parPos),
m_size(parSize),
m_surface(parTexture)
{
@ -35,9 +35,9 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
Platform::Platform (Platform&& parOther) :
Platform::Platform (Platform&& parOther) noexcept :
Placeable(parOther.GetPos()),
m_screenRatio(std::move(parOther.m_screenRatio)),
m_position(parOther.m_position),
m_size(parOther.m_size),
m_surface(parOther.m_surface)
{
@ -46,6 +46,17 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void Platform::Draw() const {
m_surface->Render(m_position, m_size, m_screenRatio.Ratio(), false);
m_surface->Render(TopLeft(), m_size, m_screenRatio.Ratio(), false);
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
Platform& Platform::operator= (const Platform& parOther) {
Drawable::operator= (parOther);
Placeable::operator= (parOther);
m_size = parOther.m_size;
m_surface = parOther.m_surface;
return *this;
}
} //namespace cloonel