|
|
@ -27,9 +27,10 @@ void Player::update(float dTime, std::vector<Wall> &walls, std::vector<Coin>& co |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (auto &wall : walls){ |
|
|
|
for (auto &wall : walls){ |
|
|
|
|
|
|
|
int wWidth = wall.size.width(); |
|
|
|
if (!wall.jumped && !wall.failed){ |
|
|
|
if (!wall.jumped && !wall.failed){ |
|
|
|
if (pos.x() > wall.pos.x() - wall.size.width() / 2 |
|
|
|
if (pos.x() > wall.pos.x() - wWidth / 2 |
|
|
|
&& pos.x() < wall.pos.x() + wall.size.width() / 2){ |
|
|
|
&& pos.x() < wall.pos.x() + wWidth / 2){ |
|
|
|
if (pos.y() < wall.pos.y() - wall.size.height()){ |
|
|
|
if (pos.y() < wall.pos.y() - wall.size.height()){ |
|
|
|
wall.jumped = true; |
|
|
|
wall.jumped = true; |
|
|
|
auto e = new WallJumpEvent; |
|
|
|
auto e = new WallJumpEvent; |
|
|
|