Mario: destroy blocks 1 at a time, if jumping and would hit only with small side, move Mario a bit so the jump is successful
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include "sprites.hpp"
|
||||
#include "editor_visitor.hpp"
|
||||
#include <unordered_map>
|
||||
#include "mario_visitor.hpp"
|
||||
|
||||
MarioBlock::MarioBlock( int x, int y,
|
||||
std::shared_ptr< SDLPP::Renderer > renderer,
|
||||
@@ -22,7 +23,7 @@ void MarioBlock::visit( SDLPP::Visitor &visitor ) {
|
||||
visitor.getVisitorType() == VisitorType::Modifier ) {
|
||||
destroy();
|
||||
}
|
||||
if(visitor.getFromId() == MARIO_TOP_DETECT && _destructible) {
|
||||
if(visitor.getFromId() == MARIO_TOP_DETECT && _destructible && dynamic_cast<MarioVisitor&>(visitor).canDestroy()) {
|
||||
destroy();
|
||||
}
|
||||
visitor.visit( *this );
|
||||
|
||||
Reference in New Issue
Block a user