Skip to content

Commit

Permalink
fix: can no longer stick to gravity blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkittyy committed Mar 10, 2023
1 parent 8704a84 commit ef3fc61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions game/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ void world::step(sf::Time dt) {
resource::get().play_sound("gravityflip");
m_flip_gravity = !m_flip_gravity;
m_dashing = false;
m_yv = m_flip_gravity ? -0.1f : 0.1f;
m_player.setScale(m_player.getScale().x, m_flip_gravity ? -1 : 1);
}

Expand Down Expand Up @@ -640,8 +641,8 @@ bool world::update(sf::Time dt) {
// some debug info
// debug::get() << "dt = " << dt.asMilliseconds() << "ms\n";
// debug::get() << "velocity = " << sf::Vector2f(m_xv, m_yv) << "\n";
// debug::get() << "touching Y-: " << m_touching[int(dir::up)] << "\n";
// debug::get() << "touching Y+: " << m_touching[int(dir::down)] << "\n";
debug::get() << "touching Y-: " << m_touching[int(dir::up)] << "\n";
debug::get() << "touching Y+: " << m_touching[int(dir::down)] << "\n";
debug::get() << "touching X-: " << m_touching[int(dir::left)] << "\n";
debug::get() << "touching X+: " << m_touching[int(dir::right)] << "\n";

Expand Down

0 comments on commit ef3fc61

Please sign in to comment.