Skip to content

Commit

Permalink
Remove extra music and fix music stream update
Browse files Browse the repository at this point in the history
  • Loading branch information
zyperpl committed Jan 8, 2024
1 parent 0c54226 commit f7e2205
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ void Game::init()

asteroid_bg_sprite = std::make_unique<Sprite>("resources/asteroid.aseprite");

station_music.push_back(LoadMusicStream("resources/music/electric-chill-pop.mp3"));
station_music.push_back(LoadMusicStream("resources/music/galactic-cafe-ambient-loop.mp3"));
station_music.push_back(LoadMusicStream("resources/music/space-elevator-background-loop.mp3"));

Expand Down Expand Up @@ -263,9 +262,6 @@ void Game::update()

void Game::update_game()
{
if (IsMusicReady(current_music) && IsMusicStreamPlaying(current_music))
UpdateMusicStream(current_music);

assert(room);

if (!gui->is_active())
Expand Down
3 changes: 2 additions & 1 deletion src/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ class Game

std::map<size_t, MissionParameters> missions;

float survive_time { 0.0f };
float survive_time{ 0.0f };

private:
[[nodiscard]] Game() noexcept = default;

Expand Down
2 changes: 1 addition & 1 deletion src/player_ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void PlayerShip::handle_input()
sound_explode.stop();

interactable->interact();
interactable = nullptr;
interactable = nullptr;
is_interacting = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/player_ship.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PlayerShip final : public Player

Timer shoot_timer{ FRAMES(20) };
Timer invincibility_timer{ FRAMES(250) };
bool is_interacting { false };
bool is_interacting{ false };

[[nodiscard]] bool is_invincible() const noexcept { return !invincibility_timer.is_done(); }

Expand Down

0 comments on commit f7e2205

Please sign in to comment.