38 lines
774 B
Rust
38 lines
774 B
Rust
use raylib::prelude::*;
|
|
|
|
use crate::{
|
|
gamecore::{GameCore, GameState},
|
|
lib::wrappers::audio::player::AudioPlayer,
|
|
};
|
|
|
|
use super::screen::Screen;
|
|
|
|
pub struct MainMenuScreen {}
|
|
|
|
impl MainMenuScreen {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
}
|
|
|
|
impl Screen for MainMenuScreen {
|
|
fn render(
|
|
&mut self,
|
|
draw_handle: &mut RaylibDrawHandle,
|
|
thread: &RaylibThread,
|
|
audio_system: &mut AudioPlayer,
|
|
game_core: &mut GameCore,
|
|
) -> Option<GameState> {
|
|
|
|
// Clear frame
|
|
draw_handle.clear_background(Color::WHITE);
|
|
|
|
// TODO: This is only for testing
|
|
if draw_handle.is_key_pressed(KeyboardKey::KEY_ESCAPE) {
|
|
return Some(GameState::PauseMenu);
|
|
}
|
|
|
|
return None;
|
|
}
|
|
}
|