Skip to content
Snippets Groups Projects
Commit 41903e0e authored by pumapaul's avatar pumapaul
Browse files

Silence warnings

parent d3685f98
Branches main
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ use tetra::input::{self, Key}; ...@@ -15,7 +15,7 @@ use tetra::input::{self, Key};
use run::Run; use run::Run;
use textures::Textures; use textures::Textures;
use crate::game_state::tile::{Tile, TreasureType}; use crate::game_state::tile::{Tile, TreasureType};
use tetra::math::{Vec2, vec2}; use tetra::math::Vec2;
use std::cmp::{min, max}; use std::cmp::{min, max};
use std::usize; use std::usize;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
...@@ -99,31 +99,43 @@ impl State for GameState { ...@@ -99,31 +99,43 @@ impl State for GameState {
impl GameState { impl GameState {
fn play_sound_player_attack(&mut self, ctx: &mut Context) { fn play_sound_player_attack(&mut self, ctx: &mut Context) {
self.sounds.hit.play(ctx); if let Err(error) = self.sounds.hit.play(ctx) {
println!("{}", error);
}
} }
fn play_sound_enemy_attack(&mut self, ctx: &mut Context) { fn play_sound_enemy_attack(&mut self, ctx: &mut Context) {
self.sounds.hit.play(ctx); self.play_sound_player_attack(ctx);
} }
fn play_sound_killed_enemy(&mut self, ctx: &mut Context) { fn play_sound_killed_enemy(&mut self, ctx: &mut Context) {
self.sounds.kill.play(ctx); if let Err(error) = self.sounds.kill.play(ctx) {
println!("{}", error);
}
} }
fn play_sound_death(&mut self, ctx: &mut Context) { fn play_sound_death(&mut self, ctx: &mut Context) {
self.sounds.gameover.play(ctx); if let Err(error) = self.sounds.gameover.play(ctx) {
println!("{}", error);
}
} }
fn play_sound_chest(&mut self, ctx: &mut Context) { fn play_sound_chest(&mut self, ctx: &mut Context) {
self.sounds.chest.play(ctx); if let Err(error) = self.sounds.chest.play(ctx) {
println!("{}", error);
}
} }
fn play_sound_level_up(&mut self, ctx: &mut Context) { fn play_sound_level_up(&mut self, ctx: &mut Context) {
self.sounds.fanfare.play(ctx); if let Err(error) = self.sounds.fanfare.play(ctx) {
println!("{}", error);
}
} }
fn play_sound_exit(&mut self, ctx: &mut Context) { fn play_sound_exit(&mut self, ctx: &mut Context) {
self.sounds.exit.play(ctx); if let Err(error) = self.sounds.exit.play(ctx) {
println!("{}", error);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment