This commit is contained in:
2024-03-27 00:17:23 -04:00
parent c01b927dfb
commit 5c9b5efbf8
12 changed files with 191 additions and 30 deletions

View File

@@ -4,25 +4,25 @@ mod phos;
use phos::PhosGamePlugin;
fn main() {
App::new()
.add_plugins((
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "Phos".into(),
name: Some("phos".into()),
resolution: (1920.0, 1080.0).into(),
resizable: false,
enabled_buttons: bevy::window::EnabledButtons {
maximize: false,
..Default::default()
},
..default()
}),
..default()
}),
WireframePlugin,
WorldInspectorPlugin::new(),
PhosGamePlugin,
))
.run();
App::new()
.add_plugins((
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "Phos".into(),
name: Some("phos".into()),
resolution: (1920.0, 1080.0).into(),
resizable: false,
enabled_buttons: bevy::window::EnabledButtons {
maximize: false,
..Default::default()
},
..default()
}),
..default()
}),
WireframePlugin,
WorldInspectorPlugin::new(),
PhosGamePlugin,
))
.run();
}

View File

@@ -1,4 +1,5 @@
use bevy::{pbr::CascadeShadowConfig, prelude::*};
use camera_system::PhosCameraPlugin;
use iyes_perf_ui::prelude::*;
use world_generation::{
heightmap::generate_heightmap, hex_utils::to_hex_pos, mesh_generator::generate_chunk_mesh,
@@ -8,6 +9,7 @@ pub struct PhosGamePlugin;
impl Plugin for PhosGamePlugin {
fn build(&self, app: &mut App) {
app.add_plugins(PhosCameraPlugin);
app.add_systems(Startup, init_game)
.add_systems(Startup, create_map);
app.add_plugins(bevy::diagnostic::FrameTimeDiagnosticsPlugin)
@@ -18,12 +20,6 @@ impl Plugin for PhosGamePlugin {
}
fn init_game(mut commands: Commands) {
commands.spawn((Camera3dBundle {
transform: Transform::from_xyz(-200., 300., -200.)
.looking_at(Vec3::new(1000., 0., 1000.), Vec3::Y),
..default()
},));
commands.spawn((
PerfUiRoot::default(),
PerfUiEntryFPS::default(),