Mario: add basic big mario logic
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "../../sdlpp/sdlpp_renderobject.hpp"
|
||||
#include "../objectids.hpp"
|
||||
#include "../sprites.hpp"
|
||||
#include "../mario.hpp"
|
||||
|
||||
void GoombaVisitor::visit(const SDLPP::RenderObject &obj) {
|
||||
auto id = obj.getId();
|
||||
@@ -49,8 +50,11 @@ void GoombaVisitor::visit(const SDLPP::RenderObject &obj) {
|
||||
death = true;
|
||||
break;
|
||||
case MARIO_ID:
|
||||
if (from == NPC_TOP_DETECT) {
|
||||
death = true;
|
||||
{
|
||||
auto &mario = dynamic_cast<const Mario &>(obj);
|
||||
if (from == NPC_TOP_DETECT && obj.getPos().getY() <= goomba_pos.getY() - BLOCK_SIZE && !mario.isJumping()) {
|
||||
death = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user