Mario: Fireball works

This commit is contained in:
2022-11-12 21:32:18 +01:00
parent 3cde73d1ed
commit 7bd652f4e9
19 changed files with 300 additions and 16 deletions
+8 -2
View File
@@ -11,13 +11,18 @@
class Mario : public MarioBlock {
public:
Mario(int x, int y, const std::shared_ptr<SDLPP::Renderer> &renderer);
Mario(const std::shared_ptr<SDLPP::Renderer> &renderer);
Mario(int x, int y, const std::shared_ptr<SDLPP::Renderer> &renderer, std::function<void(std::shared_ptr<MarioBlock>&, bool)> addObject);
Mario(const std::shared_ptr<SDLPP::Renderer> &renderer, std::function<void(std::shared_ptr<MarioBlock>&, bool)> addObject);
void walkLeft();
void walkRight();
void setStanding();
void handleVisitor(SDLPP::Visitor &visitor) override;
void jump();
#ifndef EDITOR
void fire();
void setAddObjFunc(std::function<void(std::shared_ptr<MarioBlock>&, bool)> func);
std::function<void(std::shared_ptr<MarioBlock>&, bool)> getAddObjFunc();
#endif
void stopJump();
void custom_move(int ticks) override;
void visit(SDLPP::Visitor &visitor) override;
@@ -48,6 +53,7 @@ public:
}
private:
std::function<void(std::shared_ptr<MarioBlock>&, bool)> _addObject;
void setDeath(bool dead = true) {
_death = dead;
}