lebron
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use bevy::{
|
||||
input::mouse::AccumulatedMouseMotion, pbr::NotShadowCaster, prelude::*,
|
||||
input::mouse::AccumulatedMouseMotion, prelude::*,
|
||||
render::view::RenderLayers, window::PrimaryWindow,
|
||||
};
|
||||
use bevy_rapier3d::prelude::*;
|
||||
|
||||
use crate::GameState;
|
||||
use crate::{asset_loading::{FlashlightAssets, ImageAssets}, GameState};
|
||||
|
||||
#[derive(Debug, Component)]
|
||||
pub struct Player;
|
||||
@@ -42,12 +42,9 @@ const STATIC_LAYER: usize = 1;
|
||||
|
||||
pub fn init_player(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
flashlights: Res<FlashlightAssets>,
|
||||
images: Res<ImageAssets>,
|
||||
) {
|
||||
let arm = meshes.add(Cuboid::new(0.1, 0.1, 0.5));
|
||||
let arm_material = materials.add(Color::WHITE);
|
||||
|
||||
commands
|
||||
.spawn((
|
||||
Player,
|
||||
@@ -65,10 +62,6 @@ pub fn init_player(
|
||||
},
|
||||
|
||||
Transform::from_xyz(0.0, 1.0, 0.0),
|
||||
GlobalTransform::default(),
|
||||
Visibility::default(),
|
||||
InheritedVisibility::default(),
|
||||
ViewVisibility::default(),
|
||||
))
|
||||
.with_children(|parent| {
|
||||
parent.spawn((
|
||||
@@ -78,11 +71,6 @@ pub fn init_player(
|
||||
fov: 90.0_f32.to_radians(),
|
||||
..default()
|
||||
}),
|
||||
Transform::default(),
|
||||
GlobalTransform::default(),
|
||||
Visibility::default(),
|
||||
InheritedVisibility::default(),
|
||||
ViewVisibility::default(),
|
||||
));
|
||||
|
||||
// camera voor pitslampke
|
||||
@@ -92,31 +80,21 @@ pub fn init_player(
|
||||
order: 1,
|
||||
..default()
|
||||
},
|
||||
Projection::from(PerspectiveProjection {
|
||||
fov: 70.0_f32.to_radians(),
|
||||
..default()
|
||||
}),
|
||||
RenderLayers::layer(STATIC_LAYER),
|
||||
Transform::default(),
|
||||
GlobalTransform::default(),
|
||||
Visibility::default(),
|
||||
InheritedVisibility::default(),
|
||||
ViewVisibility::default(),
|
||||
));
|
||||
|
||||
// pitslampke
|
||||
parent.spawn((
|
||||
Mesh3d(arm),
|
||||
MeshMaterial3d(arm_material),
|
||||
Transform::from_xyz(0.2, -0.1, -0.25),
|
||||
GlobalTransform::default(),
|
||||
RenderLayers::layer(STATIC_LAYER),
|
||||
NotShadowCaster,
|
||||
Visibility::default(),
|
||||
InheritedVisibility::default(),
|
||||
ViewVisibility::default(),
|
||||
Transform::from_xyz(-3.0, -3.0, 0.0),
|
||||
Sprite {
|
||||
image: images.king.clone(),
|
||||
..default()
|
||||
},
|
||||
RenderLayers::layer(STATIC_LAYER),
|
||||
));
|
||||
});
|
||||
|
||||
commands.spawn(Sprite::from_image(images.king.clone()));
|
||||
}
|
||||
|
||||
fn hide_cursor(mut windows: Query<&mut Window, With<PrimaryWindow>>) {
|
||||
|
||||
Reference in New Issue
Block a user