Skip to content

Commit

Permalink
OCLint now happy?
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmenIJsebaart committed May 25, 2017
1 parent af42bbc commit 6a08f0e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions game_sfml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ void display(
std::vector<sf::CircleShape> hit_ranges = set_hit_ranges(ps, start_positions);
std::vector<bullet> bullets;

if(sf::Joystick::isConnected(0))
{
if(sf::Joystick::isConnected(0)) {
std::cout << "controller connected" << '\n';
}

Expand All @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions player_sfml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,27 +652,25 @@ 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(); }
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
{
bullets.push_back(shoot(p1));
}
//std::cout << bullets[0].get_x() << ", " << bullets[0].get_y();
}
// player2 controls
if(p2.get_hp() > 0)
{
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));
}
}
}

1 change: 1 addition & 0 deletions player_sfml.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,5 @@ void respond_to_key(
int window_size*/
);


#endif // PLAYER_SFML_H
2 changes: 0 additions & 2 deletions power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ int get_duration(const power any_power) //!OCLINT cannot make this any shorter
//Not implemented yet
return 0;
}


2 changes: 1 addition & 1 deletion power.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a08f0e

Please sign in to comment.