add player.rs
This commit is contained in:
parent
559efc68f5
commit
1076bd569f
|
@ -1,4 +1,5 @@
|
|||
mod audio;
|
||||
mod player;
|
||||
mod camera;
|
||||
|
||||
use bevy::{
|
||||
|
@ -23,6 +24,7 @@ fn main() {
|
|||
.add_systems(Startup, (
|
||||
setup,
|
||||
audio::setup,
|
||||
player::setup,
|
||||
))
|
||||
.add_systems(Update, (
|
||||
asset_loaded.after(load_cubemap_asset),
|
||||
|
|
11
src/player.rs
Normal file
11
src/player.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Player {
|
||||
pub hp: f32,
|
||||
pub pos: Vec3,
|
||||
}
|
||||
|
||||
pub fn setup(mut commands: Commands) {
|
||||
commands.spawn(Player{ hp: 100.0, pos: Vec3::ZERO});
|
||||
}
|
Loading…
Reference in a new issue