From fdb93c03fd1ef697fdd91d4d90f0dcb7bf1779f5 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sun, 25 Apr 2021 19:07:10 -0400 Subject: [PATCH] clean unused code for fish --- src/entities/fish.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/entities/fish.rs b/src/entities/fish.rs index 6cae1ab..ed1d153 100644 --- a/src/entities/fish.rs +++ b/src/entities/fish.rs @@ -2,18 +2,10 @@ use rand::{prelude::ThreadRng, Rng}; use raylib::prelude::*; use crate::{ - gamecore::{self, GameCore}, - lib::utils::triangles::rotate_vector, player::Player, resources::GlobalResources, - world::World, }; -const FISH_FOLLOW_PLAYER_DISTANCE: f32 = 30.0; -const FISH_FOLLOW_PLAYER_SPEED: f32 = 1.8; -const FISH_FOLLOW_PLAYER_SPEED_FAST: f32 = FISH_FOLLOW_PLAYER_SPEED * 3.0; -const FISH_ATTACH_RADIUS: f32 = 20.0; - const FISH_VISION: f32 = 25.0; const FISH_MAX_SPEED: f32 = 2.0; const FISH_MAX_FORCE: f32 = 0.05; @@ -63,7 +55,7 @@ impl FishEntity { return output; } - pub fn handle_follow_player(&mut self, player: &Player, dt: f64, other_fish: &Vec) { + pub fn handle_follow_player(&mut self, player: &Player, _dt: f64, other_fish: &Vec) { let mut acceleration: Vector2 = Vector2::zero(); let mut steer: Vector2 = Vector2::zero(); @@ -140,10 +132,7 @@ impl FishEntity { self.position += self.velocity; } - pub fn handle_free_movement(&mut self, player: &mut Player, dt: f64) { - // Distance and direction to player - let dist_to_player = player.position - self.position; - let dist_to_player_lin = self.position.distance_to(player.position); + pub fn handle_free_movement(&mut self, player: &mut Player, _dt: f64) { // Handle player picking up fish if player.position.distance_to(self.position).abs() <= player.size.y * 2.2 {