2023-12-19 11:17:49 -06:00
|
|
|
use bevy::prelude::*;
|
|
|
|
|
2023-12-20 13:24:16 -06:00
|
|
|
mod assets;
|
|
|
|
mod camera;
|
2023-12-19 11:17:49 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut app = App::new();
|
2023-12-20 13:24:16 -06:00
|
|
|
app.add_plugins(DefaultPlugins.set(WindowPlugin {
|
|
|
|
primary_window: Some(Window {
|
|
|
|
title: "Kodo Tag".into(),
|
|
|
|
resolution: (800., 600.).into(),
|
|
|
|
..Default::default()
|
|
|
|
}),
|
|
|
|
..Default::default()
|
|
|
|
}))
|
|
|
|
.add_plugins((camera::Camera, assets::AssetLoader))
|
|
|
|
.add_systems(Update, keyboard_input_system)
|
|
|
|
.insert_resource(ClearColor(Color::rgb(0.3, 0., 0.5)))
|
|
|
|
.insert_resource(AmbientLight {
|
|
|
|
color: Color::rgb(1., 1., 1.),
|
|
|
|
brightness: 1.,
|
|
|
|
});
|
2023-12-19 11:17:49 -06:00
|
|
|
|
|
|
|
app.run()
|
|
|
|
}
|
|
|
|
|
2023-12-20 13:24:16 -06:00
|
|
|
fn keyboard_input_system(
|
|
|
|
keyboard_input: Res<Input<KeyCode>>,
|
|
|
|
mut app_exit_events: ResMut<Events<bevy::app::AppExit>>,
|
|
|
|
) {
|
|
|
|
if keyboard_input.pressed(KeyCode::Escape) {
|
|
|
|
app_exit_events.send(bevy::app::AppExit);
|
2023-12-19 11:17:49 -06:00
|
|
|
}
|
|
|
|
}
|