Add coin animation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "../sdlpp/sdlpp_visitor.hpp"
|
||||
#include "../sdlpp/sdlpp_geometry.hpp"
|
||||
#include "blocks.hpp"
|
||||
|
||||
class MarioVisitor : public SDLPP::Visitor {
|
||||
public:
|
||||
@@ -71,6 +72,18 @@ public:
|
||||
return coin;
|
||||
}
|
||||
|
||||
void setCoinBlock(std::shared_ptr<MarioBlock> &coin) {
|
||||
coin_block = coin;
|
||||
}
|
||||
|
||||
bool hasCoinBlock() {
|
||||
return coin_block != nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MarioBlock> &getCoinBlock() {
|
||||
return coin_block;
|
||||
}
|
||||
|
||||
private:
|
||||
bool onGround = false;
|
||||
double groundY = 0;
|
||||
@@ -87,6 +100,7 @@ private:
|
||||
bool jumping;
|
||||
bool coin = false;
|
||||
SDLPP::Vec2D<double> movement_blockage;
|
||||
std::shared_ptr<MarioBlock> coin_block = nullptr;
|
||||
};
|
||||
|
||||
class BounceVisitor : public SDLPP::Visitor {
|
||||
|
||||
Reference in New Issue
Block a user