Adds basic scene with brick in core plugin
parent
ee95440d04
commit
9d0a79f2fd
@ -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::*;
|
||||
|
||||
// extern crate hello;
|
||||
use hello::hello::HelloPlugin;
|
||||
use core::core::CorePlugin;
|
||||
|
||||
fn main()
|
||||
{
|
||||
App::new()
|
||||
.add_plugins((DefaultPlugins, HelloPlugin))
|
||||
.add_plugins((DefaultPlugins, CorePlugin))
|
||||
.run();
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue