Draw collision lines for the platforms as well.
This highlits the issue with the broken collision and bouncing.
This commit is contained in:
parent
cc0f174be5
commit
efb0f93062
4 changed files with 22 additions and 4 deletions
|
@ -32,6 +32,9 @@ namespace cloonel {
|
|||
m_size(parSize),
|
||||
m_collisionTop(new HorzCollisionBar(parPos, parSize.x())),
|
||||
m_surface(parTexture)
|
||||
#if defined(WITH_DEBUG_VISUALS)
|
||||
, m_collisionTopDrawable(parSdlMain, Colour(215, 181, 3), static_cast<short2>(parPos), static_cast<short2>(parPos + float2(parSize.x(), 0.0f)))
|
||||
#endif
|
||||
{
|
||||
assert(m_surface);
|
||||
}
|
||||
|
@ -44,6 +47,9 @@ namespace cloonel {
|
|||
m_size(parOther.m_size),
|
||||
m_collisionTop(std::move(parOther.m_collisionTop)),
|
||||
m_surface(parOther.m_surface)
|
||||
#if defined(WITH_DEBUG_VISUALS)
|
||||
, m_collisionTopDrawable(parOther.m_collisionTopDrawable)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -56,6 +62,9 @@ namespace cloonel {
|
|||
///--------------------------------------------------------------------------
|
||||
void Platform::Draw() const {
|
||||
m_surface->Render(TopLeft(), m_size, m_screenRatio.Ratio(), true);
|
||||
#if defined(WITH_DEBUG_VISUALS)
|
||||
m_collisionTopDrawable.Render(m_collisionTop->From(), m_screenRatio.Ratio());
|
||||
#endif
|
||||
}
|
||||
|
||||
///--------------------------------------------------------------------------
|
||||
|
@ -66,6 +75,9 @@ namespace cloonel {
|
|||
|
||||
m_size = parOther.m_size;
|
||||
m_surface = parOther.m_surface;
|
||||
#if defined(WITH_DEBUG_VISUALS)
|
||||
m_collisionTopDrawable = parOther.m_collisionTopDrawable;
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue