Add an offset in HorzCollisionBar and reset it at the beginning of every frame.
This commit is contained in:
parent
cdd37fead7
commit
3522ce37a3
8 changed files with 67 additions and 10 deletions
|
@ -20,6 +20,8 @@
|
|||
#include "gameplayscene.hpp"
|
||||
#include "mover.hpp"
|
||||
#include "drawable.hpp"
|
||||
#include "placeable.hpp"
|
||||
#include <unordered_set>
|
||||
|
||||
namespace cloonel {
|
||||
///--------------------------------------------------------------------------
|
||||
|
@ -32,8 +34,18 @@ namespace cloonel {
|
|||
///--------------------------------------------------------------------------
|
||||
///--------------------------------------------------------------------------
|
||||
void GameplayScene::OnUpdate (float parDelta) {
|
||||
for (auto itMover : m_movers) {
|
||||
itMover->Update(parDelta);
|
||||
{
|
||||
std::unordered_set<Placeable*> notify;
|
||||
for (auto mover : m_movers) {
|
||||
mover->CopyPlaceables(notify);
|
||||
}
|
||||
for (auto placeable : notify) {
|
||||
assert(placeable);
|
||||
placeable->BeginMovement();
|
||||
}
|
||||
}
|
||||
for (auto mover : m_movers) {
|
||||
mover->Update(parDelta);
|
||||
}
|
||||
m_collider.RunCollisionTests(parDelta);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue