Adds basic scene with brick in core plugin

master
Joey Pollack 2 years ago
parent ee95440d04
commit 9d0a79f2fd

8
Cargo.lock generated

@ -1162,6 +1162,7 @@ name = "bricks"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bevy", "bevy",
"core",
"hello", "hello",
] ]
@ -1375,6 +1376,13 @@ dependencies = [
"const_soft_float", "const_soft_float",
] ]
[[package]]
name = "core"
version = "0.1.0"
dependencies = [
"bevy",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.4" version = "0.9.4"

@ -26,9 +26,11 @@ linker = "rust-lld.exe"
[dependencies] [dependencies]
hello = { workspace = true } hello = { workspace = true }
core = { workspace = true }
bevy = { workspace = true } bevy = { workspace = true }
# bevy = { version = "0.13.0", features = ["dynamic_linking"] } # bevy = { version = "0.13.0", features = ["dynamic_linking"] }
[workspace.dependencies] [workspace.dependencies]
hello = { path = "crates/hello" } hello = { path = "crates/hello" }
core = { path = "crates/core" }
bevy = { version = "0.13.0" } bevy = { version = "0.13.0" }

@ -0,0 +1,11 @@
[package]
name = "core"
description = "The Core Module For the Game"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = { workspace = true }

@ -0,0 +1,36 @@
use bevy::{prelude::*, scene::ron::de};
pub struct CorePlugin;
impl Plugin for CorePlugin
{
fn build(&self, app: &mut App)
{
app.add_systems(Startup, setup);
}
}
fn setup(mut commands: Commands, server: Res<AssetServer>)
{
// CAMERA
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(0.0, 0.0, -25.0).looking_at(Vec3::ZERO, Vec3::Y),
..default()
});
// LIGHT
commands.spawn(PointLightBundle {
transform: Transform::from_xyz(0.0, 5.0, -5.0),
..default()
});
// BRICK
let brick_handle: Handle<Scene> = server.load("brick.glb#Scene0");
commands.spawn(SceneBundle {
scene: brick_handle,
transform: Transform::from_xyz(0.0, 0.0, 0.0),
.. default()
});
}

@ -0,0 +1,3 @@
pub mod core;

@ -1,13 +1,13 @@
use bevy::prelude::*; use bevy::prelude::*;
// extern crate hello;
use hello::hello::HelloPlugin; use hello::hello::HelloPlugin;
use core::core::CorePlugin;
fn main() fn main()
{ {
App::new() App::new()
.add_plugins((DefaultPlugins, HelloPlugin)) .add_plugins((DefaultPlugins, CorePlugin))
.run(); .run();
} }

Loading…
Cancel
Save