diff --git a/game_sfml.cpp b/game_sfml.cpp index 4783527..4c9265f 100644 --- a/game_sfml.cpp +++ b/game_sfml.cpp @@ -106,8 +106,7 @@ void display( std::vector hit_ranges = set_hit_ranges(ps, start_positions); std::vector bullets; - if(sf::Joystick::isConnected(0)) - { + if(sf::Joystick::isConnected(0)) { std::cout << "controller connected" << '\n'; } @@ -128,8 +127,7 @@ void display( //Move players, hit range and bullets for(auto i = 0u; i != ps.size(); ++i) { ps[i].move(window_size); } - for(auto& bullet : bullets) - { + for(auto& bullet : bullets) { bullet.slow_down(); bullet.move(window_size); } diff --git a/player_sfml.cpp b/player_sfml.cpp index 3c7e50e..9ac566f 100644 --- a/player_sfml.cpp +++ b/player_sfml.cpp @@ -652,7 +652,7 @@ void respond_to_key( //!OCLINT cannot simplify this even more // player1 controls if(p1.get_hp() > 0) { - if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left )) { p1.turn_left(); } + if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left )) { p1.turn_left (); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) { p1.turn_right(); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up )) { p1.accelerate(); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down )) { p1.decelerate(); } @@ -660,7 +660,6 @@ void respond_to_key( //!OCLINT cannot simplify this even more { bullets.push_back(shoot(p1)); } - //std::cout << bullets[0].get_x() << ", " << bullets[0].get_y(); } // player2 controls if(p2.get_hp() > 0) @@ -668,11 +667,10 @@ void respond_to_key( //!OCLINT cannot simplify this even more if(sf::Keyboard::isKeyPressed(sf::Keyboard::W )) { p2.accelerate(); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::D )) { p2.turn_right(); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::S )) { p2.decelerate(); } - if(sf::Keyboard::isKeyPressed(sf::Keyboard::A )) { p2.turn_left(); } + if(sf::Keyboard::isKeyPressed(sf::Keyboard::A )) { p2.turn_left (); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::Tab)) { bullets.push_back(shoot(p2)); } } } - diff --git a/player_sfml.h b/player_sfml.h index 18da3dd..abf824d 100644 --- a/player_sfml.h +++ b/player_sfml.h @@ -133,4 +133,5 @@ void respond_to_key( int window_size*/ ); + #endif // PLAYER_SFML_H diff --git a/power.cpp b/power.cpp index 97c66fb..a7930eb 100644 --- a/power.cpp +++ b/power.cpp @@ -36,5 +36,3 @@ int get_duration(const power any_power) //!OCLINT cannot make this any shorter //Not implemented yet return 0; } - - diff --git a/power.h b/power.h index 7c67073..77493f7 100644 --- a/power.h +++ b/power.h @@ -12,7 +12,7 @@ enum class power invisibility, // become invisible invisible_bullets, // shoot invisible bullets kamikaze, // everybody gets hit, including the player itself - maximize, // maxinize other players + maximize, // maximize other players mine, // put invisible mine minimize, // become smaller mix_speed, // reverse speed_x and speed_y