add player.rs

This commit is contained in:
yuni 2024-03-16 21:22:59 +01:00
parent 559efc68f5
commit 1076bd569f
2 changed files with 13 additions and 0 deletions

View file

@ -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
View 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});
}