Register the character's collision bar to the mover.

This fixes the non-working collision detection.
This commit is contained in:
King_DuckZ 2014-08-01 17:01:58 +02:00
parent c12a6407d9
commit c3baee5b9c
2 changed files with 9 additions and 0 deletions

View file

@ -79,4 +79,10 @@ namespace cloonel {
void Character::Draw() const {
m_texture->Render(GetPos(), WidthHeight(), m_screenRatio.Ratio(), true);
}
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
void Character::OnRegister (Mover& parMover, Mover::PlaceableTicketType parParentTicket) {
parMover.RegisterPlaceable(&m_bottomBar, parParentTicket);
}
} //namespace cloonel

View file

@ -45,6 +45,9 @@ namespace cloonel {
void RegisterForCollision ( ColliderRegisterFunc parRegisterCollision );
private:
//Overrides
virtual void OnRegister ( Mover& parMover, Mover::PlaceableTicketType parParentTicket );
HorzCollisionBar m_bottomBar;
SizeNotifiable<regbehaviours::AutoRegister> m_screenRatio;
const std::unique_ptr<Texture> m_texture;