rendering a spherical player!!
This commit is contained in:
parent
5b8bd5c525
commit
e65f8b26ca
4 changed files with 31 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy::{prelude::*, sprite::MaterialMesh2dBundle};
|
||||
|
||||
use bevy_rapier2d::prelude::*;
|
||||
|
||||
|
@ -12,9 +12,23 @@ pub(super) fn player_plugin(app: &mut App) {
|
|||
app.add_systems(OnEnter(AppState::InGame), add_player.in_set(IngameSet));
|
||||
}
|
||||
|
||||
pub fn add_player(mut commands: Commands) {
|
||||
pub fn add_player(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<ColorMaterial>>,
|
||||
) {
|
||||
// TODO replace
|
||||
|
||||
commands
|
||||
.spawn(Player {})
|
||||
.spawn((
|
||||
Player {},
|
||||
MaterialMesh2dBundle {
|
||||
mesh: meshes.add(Circle::new(20.)).into(),
|
||||
material: materials.add(Color::linear_rgb(0., 1., 0.)),
|
||||
transform: Transform::from_xyz(100., 100., 0.),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
.insert((
|
||||
RigidBody::Dynamic,
|
||||
Collider::cuboid(0.4 * METER, 0.9 * METER),
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy_rapier2d::prelude::*;
|
||||
|
||||
use crate::AppState;
|
||||
|
||||
pub(super) fn scene_plugin(app: &mut App) {
|
||||
// app.add_systems(, )
|
||||
app.add_systems(Startup, setup_view);
|
||||
}
|
||||
|
||||
pub(super) fn setup_view(mut commands: Commands) {
|
||||
commands.spawn(Camera2dBundle::default());
|
||||
println!("view setup");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue