63 lines
2.0 KiB
Rust
63 lines
2.0 KiB
Rust
use bevy::{prelude::*, window::PresentMode};
|
|
|
|
use bevy_egui::{EguiGlobalSettings, EguiPlugin};
|
|
|
|
use crate::config::{SCREEN_HEIGHT, SCREEN_WIDTH};
|
|
use crate::debug::DebugPlugin;
|
|
use crate::font::FontPlugin;
|
|
use crate::gameplay::bounds::BoundsPlugin;
|
|
use crate::gameplay::camera::CameraPlugin;
|
|
use crate::gameplay::collision::CollisionPlugin;
|
|
use crate::gameplay::player::PlayerPlugin;
|
|
use crate::gameplay::score::ScorePlugin;
|
|
use crate::screen::ScreenPlugin;
|
|
use crate::states::GameStatePlugin;
|
|
use crate::states::game_over::GameOverPlugin;
|
|
use crate::states::main_menu::MainMenuPlugin;
|
|
use crate::world::WorldPlugin;
|
|
|
|
mod config;
|
|
mod debug;
|
|
mod font;
|
|
mod gameplay;
|
|
mod screen;
|
|
mod states;
|
|
mod world;
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
|
primary_window: Some(Window {
|
|
title: "Down Into The Void".into(),
|
|
resolution: (SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32).into(),
|
|
present_mode: PresentMode::AutoVsync,
|
|
resize_constraints: WindowResizeConstraints {
|
|
min_width: 360.0,
|
|
min_height: 480.0,
|
|
..default()
|
|
},
|
|
..default()
|
|
}),
|
|
..default()
|
|
}))
|
|
.add_plugins(FontPlugin) // Font
|
|
.add_plugins(PlayerPlugin) // Player
|
|
.add_plugins(ScreenPlugin) // Virtual screen
|
|
.add_plugins(CameraPlugin) // Camera
|
|
.add_plugins(CollisionPlugin) // Collisions
|
|
.add_plugins(BoundsPlugin) // Bound player
|
|
.add_plugins(ScorePlugin) // Score
|
|
.add_plugins(WorldPlugin) // Chunk logic
|
|
.add_plugins(GameStatePlugin) // Game states
|
|
.add_plugins(MainMenuPlugin) // Main Menu
|
|
.add_plugins(GameOverPlugin) // GameOver
|
|
// Debug UI
|
|
.insert_resource(EguiGlobalSettings {
|
|
auto_create_primary_context: false,
|
|
..default()
|
|
})
|
|
.add_plugins(EguiPlugin::default()) // Debug UI
|
|
.add_plugins(DebugPlugin) // Debug
|
|
.run();
|
|
}
|