restore after broken git
This commit is contained in:
commit
138c62ac34
51 changed files with 7559 additions and 0 deletions
56
src/main.rs
Normal file
56
src/main.rs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
use crate::common::messages::ExitRequestMessage;
|
||||
use crate::common::plugin::CommonUiPlugin;
|
||||
use crate::common::systems::exit_system;
|
||||
use bevy::camera::ScalingMode;
|
||||
use bevy::prelude::*;
|
||||
|
||||
|
||||
mod common;
|
||||
mod gameplay;
|
||||
mod states;
|
||||
mod ui;
|
||||
|
||||
use crate::states::game::state::MainGameState;
|
||||
use crate::states::main_menu::state::MainMenuState;
|
||||
use crate::states::settings_menu::state::SettingsMenuState;
|
||||
|
||||
const FACTOR: u32 = 80;
|
||||
const WIDTH: u32 = 16;
|
||||
const HEIGHT: u32 = 9;
|
||||
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_message::<ExitRequestMessage>()
|
||||
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||
primary_window: Some(Window {
|
||||
title: "alpha".into(),
|
||||
resolution: (WIDTH * FACTOR, HEIGHT * FACTOR).into(),
|
||||
resizable: true,
|
||||
..default()
|
||||
}),
|
||||
..default()
|
||||
}))
|
||||
.add_plugins((
|
||||
CommonUiPlugin,
|
||||
MainMenuState,
|
||||
SettingsMenuState,
|
||||
MainGameState,
|
||||
))
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, exit_system)
|
||||
.run();
|
||||
}
|
||||
|
||||
fn setup(mut commands: Commands) {
|
||||
let projection = Projection::Orthographic(OrthographicProjection {
|
||||
scaling_mode: ScalingMode::Fixed {
|
||||
width: (WIDTH * FACTOR) as f32,
|
||||
height: (HEIGHT * FACTOR) as f32,
|
||||
},
|
||||
scale: 1.00,
|
||||
..OrthographicProjection::default_2d()
|
||||
});
|
||||
|
||||
commands.spawn((Camera2d, projection));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue