Extract entities
This commit is contained in:
parent
b7780b8862
commit
cef21f4a00
4 changed files with 24 additions and 20 deletions
1
src/game/mod.rs
Normal file
1
src/game/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod objects;
|
18
src/game/objects.rs
Normal file
18
src/game/objects.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use avian2d::prelude::*;
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component, Default)]
|
||||
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform)]
|
||||
struct GameObject;
|
||||
|
||||
#[derive(Component, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Dynamic)]
|
||||
pub struct Ball;
|
||||
|
||||
#[derive(Component, Default)]
|
||||
#[require(Ball)]
|
||||
pub struct Player;
|
||||
|
||||
#[derive(Component, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Static)]
|
||||
pub struct Wall;
|
Loading…
Add table
Add a link
Reference in a new issue