diff --git a/README.md b/README.md index 85786ba..8543c25 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ Core libraries: - [`serde`](https://serde.rs/) - [`serialstudio-rs`](https://github.com/Ewpratten/serialstudio-rs) +Sound Samples: + - [JavierZumer](https://freesound.org/people/JavierZumer/sounds/257236/) + - [Noted451](https://freesound.org/people/Noted451/sounds/531015/) + ### VSCode Setup If using VSCode, disable the `Rust` extension, and install everything in the **Workspace Recommendations** (You will see this list by searching `@recommended` in the extensions panel) diff --git a/assets/audio/succ.mp3 b/assets/audio/succ.mp3 new file mode 100644 index 0000000..4e98655 Binary files /dev/null and b/assets/audio/succ.mp3 differ diff --git a/assets/audio/swimSong.mp3 b/assets/audio/swimSong.mp3 index a9ef7bd..71e0bf2 100644 Binary files a/assets/audio/swimSong.mp3 and b/assets/audio/swimSong.mp3 differ diff --git a/assets/audio/zap.mp3 b/assets/audio/zap.mp3 new file mode 100644 index 0000000..5fd08f2 Binary files /dev/null and b/assets/audio/zap.mp3 differ diff --git a/assets/img/map/tutorial2.png b/assets/img/map/tut1.png similarity index 100% rename from assets/img/map/tutorial2.png rename to assets/img/map/tut1.png diff --git a/assets/img/map/tutorial1.png b/assets/img/map/tut2.png similarity index 100% rename from assets/img/map/tutorial1.png rename to assets/img/map/tut2.png diff --git a/assets/worlds/mainworld.json b/assets/worlds/mainworld.json index 5c86b0f..d749e10 100644 --- a/assets/worlds/mainworld.json +++ b/assets/worlds/mainworld.json @@ -276,6 +276,19 @@ "stun_timer": 0.0, "puffer_state": "SmallIdle" + }, + { + "position" : { + "x":260, + "y":1472 + }, + "is_knocking_back": false, + "time_knocking_back": 0.0, + "inflate_timer": 0.0, + "is_large": false, + "stun_timer": 0.0, + "puffer_state": "SmallIdle" + } ] diff --git a/src/entities/enemy/base.rs b/src/entities/enemy/base.rs index ddddc49..7a8988e 100644 --- a/src/entities/enemy/base.rs +++ b/src/entities/enemy/base.rs @@ -10,6 +10,6 @@ pub trait EnemyBase { resources: &mut GlobalResources, dt: f64, ); - fn handle_logic(&mut self, player: &mut Player, dt: f64); + fn handle_logic(&mut self, player: &mut Player, dt: f64) -> u8; fn handle_getting_attacked(&mut self, stun_duration: f64, current_time: f64); } diff --git a/src/entities/enemy/jellyfish.rs b/src/entities/enemy/jellyfish.rs index b1fcc80..5aff1bc 100644 --- a/src/entities/enemy/jellyfish.rs +++ b/src/entities/enemy/jellyfish.rs @@ -77,13 +77,14 @@ impl EnemyBase for JellyFish { && !is_jelly_stunned; } - fn handle_logic(&mut self, player: &mut Player, _dt: f64) { + fn handle_logic(&mut self, player: &mut Player, _dt: f64) -> u8 { // Handle stunning the player if self.do_stun_player { if self.position.distance_to(player.position).abs() <= JELLYFISH_STUN_REACH { player.set_stun_seconds(JELLYFISH_STUN_DURATION); } } + return 0; } fn handle_getting_attacked(&mut self, stun_duration: f64, _current_time: f64) { diff --git a/src/entities/enemy/octopus.rs b/src/entities/enemy/octopus.rs index 5d57e46..dad3408 100644 --- a/src/entities/enemy/octopus.rs +++ b/src/entities/enemy/octopus.rs @@ -123,16 +123,19 @@ impl EnemyBase for Octopus { } } - fn handle_logic(&mut self, player: &mut crate::player::Player, _dt: f64) { + fn handle_logic(&mut self, player: &mut crate::player::Player, _dt: f64) -> u8 { if self.suck_air_time_remaining > 0.0 && !self.has_taken_air_from_player { if player.position.distance_to(self.current_position).abs() <= OCTOPUS_SUCK_AIR_RANGE { // Take air from the player player.breath_percent -= OCTOPUS_SUCK_AIR_AMOUNT; - + // Set the flag self.has_taken_air_from_player = true; + + return 1; } } + return 0; } fn handle_getting_attacked(&mut self, stun_duration: f64, _current_time: f64) { diff --git a/src/entities/enemy/pufferfish.rs b/src/entities/enemy/pufferfish.rs index 9f72119..6956ab8 100644 --- a/src/entities/enemy/pufferfish.rs +++ b/src/entities/enemy/pufferfish.rs @@ -39,7 +39,7 @@ impl EnemyBase for Pufferfish { // Render the stun ring if is_stunned { - println!("Stunned"); + // println!("Stunned"); let stun_ring_alpha = calculate_linear_slide(self.stun_timer / 1.0); context_2d.draw_circle_v( @@ -66,7 +66,7 @@ impl EnemyBase for Pufferfish { angle, ); - if self.position.distance_to(player.position).abs() <= 100.0 && self.inflate_timer > 1.0{ + if self.position.distance_to(player.position).abs() <= 100.0 && self.inflate_timer > 2.0{ self.puffer_state = PufferState::Growing; } self.is_large = false; @@ -128,7 +128,7 @@ impl EnemyBase for Pufferfish { } } - fn handle_logic(&mut self, player: &mut crate::player::Player, dt: f64) { + fn handle_logic(&mut self, player: &mut crate::player::Player, dt: f64) -> u8 { @@ -144,6 +144,8 @@ impl EnemyBase for Pufferfish { self.inflate_timer = 0.0; } + return 0; + } fn handle_getting_attacked(&mut self, stun_duration: f64, current_time: f64) { diff --git a/src/entities/enemy/whirlpool.rs b/src/entities/enemy/whirlpool.rs index a2b7bf0..2af0d79 100644 --- a/src/entities/enemy/whirlpool.rs +++ b/src/entities/enemy/whirlpool.rs @@ -38,8 +38,8 @@ impl EnemyBase for Whirlpool{ self.rotation += 1.0; } - fn handle_logic(&mut self, player: &mut crate::player::Player, dt: f64) { - + fn handle_logic(&mut self, player: &mut crate::player::Player, dt: f64) -> u8 { + return 0; } // Whirlpool removed if shoot diff --git a/src/entities/fish.rs b/src/entities/fish.rs index ccaeca0..2d609c2 100644 --- a/src/entities/fish.rs +++ b/src/entities/fish.rs @@ -1,7 +1,7 @@ use rand::{prelude::ThreadRng, Rng}; use raylib::prelude::*; -use crate::{player::Player, resources::GlobalResources}; +use crate::{gamecore::{self, GameCore}, lib::wrappers::audio::player::AudioPlayer, player::Player, resources::GlobalResources}; const FISH_VISION: f32 = 25.0; const FISH_MAX_SPEED: f32 = 2.0; @@ -12,6 +12,7 @@ const FISH_FACTOR_COHESION: f32 = 0.1; const FISH_SEPARATION_DISTANCE: f32 = 15.0; const FISH_FACTOR_SEPARATION: f32 = 1.5; + #[derive(Debug, Clone)] pub struct FishEntity { position: Vector2, @@ -134,25 +135,31 @@ impl FishEntity { self.position += self.velocity; } - pub fn handle_free_movement(&mut self, player: &mut Player, _dt: f64) { + pub fn handle_free_movement(&mut self, player: &mut Player, _dt: f64) -> bool { // Handle player picking up fish if player.position.distance_to(self.position).abs() <= player.size.y * 2.2 { self.following_player = true; self.velocity = self.direction.normalized(); self.current_frame = 0; self.animation_counter = 0; - + // Add currency to the player player.coins += 1; + + return true; } + return false } - pub fn update_position(&mut self, player: &mut Player, dt: f64, other_fish: &Vec) { + pub fn update_position(&mut self, player: &mut Player, dt: f64, other_fish: &Vec) -> bool{ if self.following_player { self.handle_follow_player(player, dt, other_fish); } else { - self.handle_free_movement(player, dt); + if self.handle_free_movement(player, dt) { + return true; + } } + return false; } pub fn render( diff --git a/src/items.rs b/src/items.rs index 364dc99..1a63e08 100644 --- a/src/items.rs +++ b/src/items.rs @@ -61,11 +61,11 @@ impl ItemBase for StunGun { } fn get_name(&self) -> String { - return "Stun Gun".to_string(); + return "Stun Bomb".to_string(); } fn get_description(&self) -> String { - return "Stun your enemies!\nJust don't point it at yourself.".to_string(); + return "Right click to stun enemies\n one use per dive".to_string(); } fn get_texture( diff --git a/src/logic/ingame/hud.rs b/src/logic/ingame/hud.rs index e7e508d..b475546 100644 --- a/src/logic/ingame/hud.rs +++ b/src/logic/ingame/hud.rs @@ -18,6 +18,9 @@ pub fn render_hud( + slider_bound_height, }; + draw_handle.draw_rectangle(10, 10, 20, 700, Color::new(0, 50, 255, 50)); + draw_handle.draw_rectangle( 10, 710 - (game_core.player.breath_percent * 450.0) as i32, 20, (game_core.player.breath_percent * 450.0) as i32, Color::new(0, 50, 255, 125)); + // Render the base of the slider draw_handle.draw_rectangle( (progress_slider_position.x - slider_bound_height) as i32, diff --git a/src/logic/ingame/mod.rs b/src/logic/ingame/mod.rs index 9f9970a..998afeb 100644 --- a/src/logic/ingame/mod.rs +++ b/src/logic/ingame/mod.rs @@ -2,15 +2,14 @@ mod hud; mod playerlogic; use raylib::prelude::*; - -use crate::{entities::enemy::{base::EnemyBase, whirlpool::Whirlpool}, gamecore::{GameCore, GameState}, lib::wrappers::audio::player::AudioPlayer}; +use crate::{entities::enemy::{base::EnemyBase, whirlpool::Whirlpool}, gamecore::{self, GameCore, GameState}, lib::wrappers::audio::player::AudioPlayer}; use super::screen::Screen; use crate::entities::fish::FishEntity; - pub struct InGameScreen { shader_time_var_location: i32, + swim_playing: bool, } impl InGameScreen { @@ -20,6 +19,7 @@ impl InGameScreen { *game_core.resources.pixel_shader, rstr!("time").as_ptr(), ), + swim_playing: false, } } @@ -28,6 +28,7 @@ impl InGameScreen { context_2d: &mut RaylibMode2D, game_core: &mut GameCore, dt: f64, + audio_system: &mut AudioPlayer, ) { // Build source bounds let source_bounds = Rectangle { @@ -92,9 +93,53 @@ impl InGameScreen { // Render fish let fish_clone = game_core.world.fish.clone(); for fish in game_core.world.fish.iter_mut() { - fish.update_position(&mut game_core.player, dt, &fish_clone); + if fish.update_position(&mut game_core.player, dt, &fish_clone) { + audio_system.play_sound(&game_core.resources.fish_pickup); + } fish.render(context_2d, &mut game_core.resources); } + context_2d.draw_texture_pro( + &game_core.resources.tut1, + Rectangle { + x: 0.0, + y: 0.0, + width: 44.0, + height: 41.0, + }, + Rectangle { + x: 110.0, + y: 100.0, + width: 44.0, + height: 41.0, + }, + Vector2 { + x: 0.0, + y: 0.0, + }, + 0.0, + Color::WHITE, + ); + context_2d.draw_texture_pro( + &game_core.resources.tut2, + Rectangle { + x: 0.0, + y: 0.0, + width: 44.0, + height: 41.0, + }, + Rectangle { + x: 160.0, + y: 110.0, + width: 44.0, + height: 41.0, + }, + Vector2 { + x: 0.0, + y: 0.0, + }, + 0.0, + Color::WHITE, + ); // Render the world texture context_2d.draw_texture_rec( @@ -190,6 +235,11 @@ impl Screen for InGameScreen { return Some(GameState::PauseMenu); } + // music + if !_audio_system.is_sound_playing(&game_core.resources.song_swim) { + _audio_system.play_sound(&game_core.resources.song_swim); + } + // Window dimensions let win_height = draw_handle.get_screen_height(); let win_width = draw_handle.get_screen_width(); @@ -199,7 +249,12 @@ impl Screen for InGameScreen { }; // Update player movement - playerlogic::update_player_movement(draw_handle, game_core, window_center); + playerlogic::update_player_movement(draw_handle, game_core, window_center, _audio_system); + + if draw_handle.get_time() % 10.0 <= 0.1 && !_audio_system.is_sound_playing(&game_core.resources.breath){ + _audio_system.set_sound_volume(&game_core.resources.breath, 0.5); + _audio_system.play_sound(&game_core.resources.breath); + } // Open a 2D context { @@ -213,7 +268,7 @@ impl Screen for InGameScreen { context_2d.clear_background(Color::BLACK); // Render the world - self.render_world(&mut context_2d, game_core, dt); + self.render_world(&mut context_2d, game_core, dt, _audio_system); if game_core.show_simple_debug_info { self.render_colliders(&mut context_2d, game_core); } @@ -229,7 +284,9 @@ impl Screen for InGameScreen { ); } for octopus in game_core.world.octopus.iter_mut() { - octopus.handle_logic(&mut game_core.player, dt); + if octopus.handle_logic(&mut game_core.player, dt) == 1 { + _audio_system.play_sound(&game_core.resources.succ); + } octopus.render( &mut context_2d, &mut game_core.player, diff --git a/src/logic/ingame/playerlogic.rs b/src/logic/ingame/playerlogic.rs index 0eee09e..4e46216 100644 --- a/src/logic/ingame/playerlogic.rs +++ b/src/logic/ingame/playerlogic.rs @@ -1,6 +1,6 @@ use raylib::core::audio::RaylibAudio; use raylib::prelude::*; - +use rand::{prelude::ThreadRng, Rng}; use crate::{gamecore::GameCore, lib::wrappers::audio::player::AudioPlayer}; const NORMAL_PLAYER_SPEED: i32 = 1; @@ -18,10 +18,9 @@ pub fn update_player_movement( draw_handle: &mut RaylibDrawHandle, game_core: &mut GameCore, window_center: Vector2, + audio_system: &mut AudioPlayer ) { - // let mut p: AudioPlayer = AudioPlayer::new(RaylibAudio::init_audio_device()); - // p.play_sound(&game_core.resources.breath); // Calculate DT let dt = draw_handle.get_time() - game_core.last_frame_time; @@ -82,11 +81,26 @@ pub fn update_player_movement( let user_request_boost = draw_handle.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON); let user_request_action = draw_handle.is_mouse_button_pressed(MouseButton::MOUSE_RIGHT_BUTTON); - if user_request_action { + if user_request_action && !game_core.player.has_stunned { + game_core.player.has_stunned = true; game_core .player .begin_attack(&mut game_core.world, draw_handle.get_time()); - //println!("{{\"x\":{}, \"y\":{}}},",f32::round(game_core.player.position.x),f32::round(game_core.player.position.y)); + } + + if user_request_action { + // println!("{{\"x\":{}, \"y\":{}}},",f32::round(game_core.player.position.x),f32::round(game_core.player.position.y)); + } + + // die sound + if game_core.player.breath_percent <= 0.06 { + if !audio_system.is_sound_playing(&game_core.resources.die) { + audio_system.play_sound(&game_core.resources.die); + } + } + + if (game_core.player.stun_timer > 0.0 || game_core.player.is_stun_gun_active()) && !audio_system.is_sound_playing(&game_core.resources.zap) { + audio_system.play_sound(&game_core.resources.zap); } // Move the player in their direction @@ -95,6 +109,21 @@ pub fn update_player_movement( // Set the speed multiplier speed_multiplier = BOOST_PLAYER_SPEED as f32; + // swim sound + if !audio_system.is_sound_playing(&game_core.resources.swim1) && !audio_system.is_sound_playing(&game_core.resources.swim2) && !audio_system.is_sound_playing(&game_core.resources.swim3) && !audio_system.is_sound_playing(&game_core.resources.swim4) { + let mut rng = rand::thread_rng(); + let num = rng.gen_range(0..3); + if num == 0 { + audio_system.play_sound(&game_core.resources.swim1); + } else if num == 1 { + audio_system.play_sound(&game_core.resources.swim2); + } else if num == 2 { + audio_system.play_sound(&game_core.resources.swim3); + } else { + audio_system.play_sound(&game_core.resources.swim4); + } + } + // Decrease the boost game_core.player.boost_percent -= BOOST_DECREASE_PER_SECOND * dt as f32; game_core.player.is_boosting = true; @@ -221,7 +250,7 @@ pub fn update_player_movement( let angle = net_pose.y.atan2(net_pose.x); // Calculates force - let force = 1.0; + let force = 0.2; // Calculates componets of force let mut force_x = (force as f32 * angle.cos()).clamp(-1.0, 1.0); diff --git a/src/logic/mainmenu.rs b/src/logic/mainmenu.rs index 475e9bc..de45d6d 100644 --- a/src/logic/mainmenu.rs +++ b/src/logic/mainmenu.rs @@ -90,10 +90,11 @@ impl Screen for MainMenuScreen { if hovering_play_button { // Reset the world game_core.world.reset(&mut game_core.player); - + _audio_system.play_sound(&game_core.resources.ui_click); // Start playing return Some(GameState::InGame); } else if hovering_shop_button { + _audio_system.play_sound(&game_core.resources.ui_click); return Some(GameState::InShop); } else if hovering_quit_button { return Some(GameState::GameQuit); diff --git a/src/logic/pausemenu.rs b/src/logic/pausemenu.rs index 6d265c0..4b5bc32 100644 --- a/src/logic/pausemenu.rs +++ b/src/logic/pausemenu.rs @@ -171,8 +171,10 @@ impl Screen for PauseMenuScreen { // Handle click actions on the buttons if draw_handle.is_mouse_button_pressed(MouseButton::MOUSE_LEFT_BUTTON) { if menu_button.is_hovered(draw_handle) { + audio_system.play_sound(&game_core.resources.ui_click); return Some(GameState::MainMenu); } else if close_button.is_hovered(draw_handle) { + audio_system.play_sound(&game_core.resources.ui_click); return Some(game_core.last_state); } } diff --git a/src/logic/shop/mainui.rs b/src/logic/shop/mainui.rs index 72c2c57..c036d38 100644 --- a/src/logic/shop/mainui.rs +++ b/src/logic/shop/mainui.rs @@ -112,12 +112,14 @@ pub fn render_shop( { let item = stun_gun_buy_ui.purchase(&mut game_core.player); game_core.player.inventory.stun_gun = Some(item); + _audio_system.play_sound(&game_core.resources.ui_buy); } if air_bag_buy_ui.can_player_afford(&game_core.player, &game_core.player.inventory.air_bag) && air_bag_buy_ui.user_clicked_buy(draw_handle) { let item = air_bag_buy_ui.purchase(&mut game_core.player); game_core.player.inventory.air_bag = Some(item); + _audio_system.play_sound(&game_core.resources.ui_buy); } if flashlight_buy_ui .can_player_afford(&game_core.player, &game_core.player.inventory.flashlight) @@ -125,12 +127,14 @@ pub fn render_shop( { let item = flashlight_buy_ui.purchase(&mut game_core.player); game_core.player.inventory.flashlight = Some(item); + _audio_system.play_sound(&game_core.resources.ui_buy); } if flippers_buy_ui.can_player_afford(&game_core.player, &game_core.player.inventory.flippers) && flippers_buy_ui.user_clicked_buy(draw_handle) { let item = flippers_buy_ui.purchase(&mut game_core.player); game_core.player.inventory.flippers = Some(item); + _audio_system.play_sound(&game_core.resources.ui_buy); } // Render the tooltip box @@ -232,6 +236,7 @@ pub fn render_shop( .player .create_statistics(game_core, draw_handle.get_time()); game_core.progress.update(&new_progress); + _audio_system.play_sound(&game_core.resources.ui_click); } if menu_button.is_hovered(draw_handle) { diff --git a/src/logic/shop/mod.rs b/src/logic/shop/mod.rs index dcc1aa3..29d9030 100644 --- a/src/logic/shop/mod.rs +++ b/src/logic/shop/mod.rs @@ -33,6 +33,18 @@ impl Screen for ShopScreen { // Render the background draw_handle.draw_texture(&game_core.resources.shop_background, 0, 0, Color::WHITE); + if !audio_system.is_sound_playing(&game_core.resources.song_shop) { + audio_system.play_sound(&game_core.resources.song_shop); + } + + draw_handle.draw_text( + &format!("you really need to get to the bottom huh?\n Well then buy my wares,\n they will help you get to your doo-hicky"), + 10, + 50, + 20, + Color::WHITE, + ); + // Window dimensions let win_height = draw_handle.get_screen_height(); let win_width = draw_handle.get_screen_width(); diff --git a/src/main.rs b/src/main.rs index 27cabe3..00efc56 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,6 +131,16 @@ fn main() { // If needed, update the global state if new_state.is_some() { let new_state = new_state.unwrap(); + + // stop music + if (new_state != GameState::PauseMenu && game_core.state != GameState::PauseMenu) || new_state == GameState::MainMenu { + if audio_system.is_sound_playing(&game_core.resources.song_shop) { + audio_system.stop_sound(&game_core.resources.song_shop); + } + if audio_system.is_sound_playing(&game_core.resources.song_swim) { + audio_system.stop_sound(&game_core.resources.song_swim); + } + } // Handle game quit if new_state == GameState::GameQuit { diff --git a/src/player.rs b/src/player.rs index c173602..0ae243a 100644 --- a/src/player.rs +++ b/src/player.rs @@ -44,6 +44,7 @@ pub struct Player { pub inventory: PlayerInventory, pub stun_timer: f64, pub attacking_timer: f64, + pub has_stunned: bool, } impl Player { @@ -55,6 +56,7 @@ impl Player { breath_percent: 1.0, is_moving: true, radius: 4.5, + has_stunned: false, position: spawn.clone(), inventory: PlayerInventory::new(), ..Default::default() @@ -65,6 +67,7 @@ impl Player { self.position = position; self.breath_percent = 1.0; self.boost_percent = 1.0; + self.has_stunned = false; // Handle an air bag being used if self.inventory.air_bag.is_some() { @@ -150,25 +153,28 @@ impl Player { // Render the player's boost ring // This functions both as a breath meter, and as a boost meter - let boost_ring_max_radius = self.size.x + 5.0; - context_2d.draw_circle( - self.position.x as i32, - self.position.y as i32, - boost_ring_max_radius * self.boost_percent, - TRANSLUCENT_WHITE_64, - ); - context_2d.draw_ring( - Vector2 { - x: self.position.x as i32 as f32, - y: self.position.y as i32 as f32, - }, - boost_ring_max_radius, - boost_ring_max_radius + 1.0, - 0, - (360.0 * self.breath_percent) as i32, - 0, - TRANSLUCENT_WHITE_96, - ); + // let boost_ring_max_radius = self.size.x + 5.0; + // context_2d.draw_circle( + // self.position.x as i32, + // self.position.y as i32, + // boost_ring_max_radius * self.boost_percent, + // TRANSLUCENT_WHITE_64, + // ); + + context_2d.draw_rectangle(self.position.x as i32 - 15,self.position.y as i32 + 15, 30, 4, Color::new(255, 255, 0, 50)); + context_2d.draw_rectangle(self.position.x as i32 - 15,self.position.y as i32 + 15, (30.0 * self.boost_percent) as i32, 4, Color::new(255, 255, 0, 125)); + // context_2d.draw_ring( + // Vector2 { + // x: self.position.x as i32 as f32, + // y: self.position.y as i32 as f32, + // }, + // boost_ring_max_radius, + // boost_ring_max_radius + 1.0, + // 0, + // (360.0 * self.breath_percent) as i32, + // 0, + // TRANSLUCENT_WHITE_96, + // ); // Calculate AOE ring if self.is_stun_gun_active() { diff --git a/src/resources.rs b/src/resources.rs index 589a8fd..822ce33 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -58,12 +58,28 @@ pub struct GlobalResources { pub flippers_one: Texture2D, pub flippers_two: Texture2D, pub flippers_three: Texture2D, + + // tut + pub tut1: Texture2D, + pub tut2: Texture2D, // Treasure pub transponder: FrameAnimationWrapper, // Audio pub breath: Sound, + pub swim1: Sound, + pub swim2: Sound, + pub swim3: Sound, + pub swim4: Sound, + pub die: Sound, + pub ui_buy: Sound, + pub ui_click: Sound, + pub fish_pickup: Sound, + pub song_shop: Sound, + pub song_swim: Sound, + pub zap: Sound, + pub succ: Sound, } impl GlobalResources { @@ -241,6 +257,14 @@ impl GlobalResources { &thread, &Image::load_image("./assets/img/items/flippers3.png")?, )?), + tut1: (raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/map/tut1.png")?, + )?), + tut2: (raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/map/tut2.png")?, + )?), transponder: FrameAnimationWrapper::new( raylib.load_texture_from_image( &thread, @@ -266,7 +290,7 @@ impl GlobalResources { )?, Vector2 { x: 19.0, y: 19.0 }, 3, - 2, + 4, ), pufferfish_small: FrameAnimationWrapper::new( raylib.load_texture_from_image( @@ -275,7 +299,7 @@ impl GlobalResources { )?, Vector2 { x: 19.0, y: 19.0 }, 6, - 2, + 4, ), pufferfish_attack: FrameAnimationWrapper::new( raylib.load_texture_from_image( @@ -284,7 +308,7 @@ impl GlobalResources { )?, Vector2 { x: 39.0, y: 25.0 }, 4, - 2, + 4, ), pufferfish_expand: FrameAnimationWrapper::new( raylib.load_texture_from_image( @@ -293,9 +317,21 @@ impl GlobalResources { )?, Vector2 { x: 19.0, y: 19.0 }, 4, - 2, + 4, ), - breath: Sound::load_sound("./assets/audio/breath.mp3")? + breath: Sound::load_sound("./assets/audio/breath.mp3")?, + swim1: Sound::load_sound("./assets/audio/swim1.mp3")?, + swim2: Sound::load_sound("./assets/audio/swim2.mp3")?, + swim3: Sound::load_sound("./assets/audio/swim3.mp3")?, + swim4: Sound::load_sound("./assets/audio/swim4.mp3")?, + die: Sound::load_sound("./assets/audio/die.mp3")?, + ui_buy: Sound::load_sound("./assets/audio/uiBuy.mp3")?, + ui_click: Sound::load_sound("./assets/audio/uiClick.mp3")?, + fish_pickup: Sound::load_sound("./assets/audio/fishPickup.mp3")?, + song_shop: Sound::load_sound("./assets/audio/shopSong.mp3")?, + song_swim: Sound::load_sound("./assets/audio/swimSong.mp3")?, + zap: Sound::load_sound("./assets/audio/zap.mp3")?, + succ: Sound::load_sound("./assets/audio/succ.mp3")?, }) } }