This repository has been archived on 2021-04-27. You can view files and clone it, but cannot push or open issues or pull requests.
ludum-dare-48/src/logic/mainmenu.rs

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;
}
}