Mario: add turtle enemy
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "../objectids.hpp"
|
||||
#include "../sprites.hpp"
|
||||
#include "../mario.hpp"
|
||||
#include "../blocks/turtleblock.hpp"
|
||||
|
||||
void GoombaVisitor::visit(const SDLPP::RenderObject &obj) {
|
||||
auto id = obj.getId();
|
||||
@@ -47,7 +48,15 @@ void GoombaVisitor::visit(const SDLPP::RenderObject &obj) {
|
||||
}
|
||||
break;
|
||||
case DEATH_ID:
|
||||
death = true;
|
||||
instant_death = true;
|
||||
break;
|
||||
case TURTLE_ID:
|
||||
{
|
||||
auto &turtle = dynamic_cast<const TurtleBlock &>(obj);
|
||||
if(turtle.isShell() && turtle.getMovement().getX() != 0) {
|
||||
death = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MARIO_ID:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user