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:
parent
976d34f17e
commit
4a3a0a4782
13 changed files with 251 additions and 55 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue