add player.rs
This commit is contained in:
parent
559efc68f5
commit
1076bd569f
|
@ -1,4 +1,5 @@
|
||||||
mod audio;
|
mod audio;
|
||||||
|
mod player;
|
||||||
mod camera;
|
mod camera;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
|
@ -23,6 +24,7 @@ fn main() {
|
||||||
.add_systems(Startup, (
|
.add_systems(Startup, (
|
||||||
setup,
|
setup,
|
||||||
audio::setup,
|
audio::setup,
|
||||||
|
player::setup,
|
||||||
))
|
))
|
||||||
.add_systems(Update, (
|
.add_systems(Update, (
|
||||||
asset_loaded.after(load_cubemap_asset),
|
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