clean root ingame

This commit is contained in:
Evan Pratten 2021-04-25 19:09:28 -04:00
parent 068c8be089
commit 7edfe6f132

View File

@ -7,25 +7,18 @@ use crate::{
entities::enemy::base::EnemyBase, entities::enemy::base::EnemyBase,
gamecore::{GameCore, GameState}, gamecore::{GameCore, GameState},
lib::wrappers::audio::player::AudioPlayer, lib::wrappers::audio::player::AudioPlayer,
pallette::{SKY, WATER, WATER_DARK},
}; };
use super::screen::Screen; use super::screen::Screen;
pub enum InGameState {
BUYING,
SWIMMING,
}
pub struct InGameScreen { pub struct InGameScreen {
current_state: InGameState,
shader_time_var_location: i32, shader_time_var_location: i32,
} }
impl InGameScreen { impl InGameScreen {
pub unsafe fn new(game_core: &GameCore) -> Self { pub unsafe fn new(game_core: &GameCore) -> Self {
Self { Self {
current_state: InGameState::SWIMMING,
shader_time_var_location: raylib::ffi::GetShaderLocation( shader_time_var_location: raylib::ffi::GetShaderLocation(
*game_core.resources.pixel_shader, *game_core.resources.pixel_shader,
rstr!("time").as_ptr(), rstr!("time").as_ptr(),
@ -188,8 +181,8 @@ impl Screen for InGameScreen {
fn render( fn render(
&mut self, &mut self,
draw_handle: &mut RaylibDrawHandle, draw_handle: &mut RaylibDrawHandle,
thread: &RaylibThread, _thread: &RaylibThread,
audio_system: &mut AudioPlayer, _audio_system: &mut AudioPlayer,
game_core: &mut GameCore, game_core: &mut GameCore,
) -> Option<GameState> { ) -> Option<GameState> {
// Calculate DT // Calculate DT
@ -207,7 +200,6 @@ impl Screen for InGameScreen {
x: (win_width as f32 / 2.0), x: (win_width as f32 / 2.0),
y: (win_height as f32 / 2.0), y: (win_height as f32 / 2.0),
}; };
let camera_window_center = window_center * (1.0 / game_core.master_camera.zoom);
// Update player movement // Update player movement
playerlogic::update_player_movement(draw_handle, game_core, window_center); playerlogic::update_player_movement(draw_handle, game_core, window_center);