clean unused code for fish
This commit is contained in:
parent
a74ba44e77
commit
fdb93c03fd
@ -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<FishEntity>) {
|
||||
pub fn handle_follow_player(&mut self, player: &Player, _dt: f64, other_fish: &Vec<FishEntity>) {
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user