This commit is contained in:
parent
fc95857824
commit
6a151397de
7 changed files with 21 additions and 1 deletions
|
@ -1,18 +1,22 @@
|
|||
use avian2d::prelude::*;
|
||||
use bevy::prelude::*;
|
||||
|
||||
/// Basic implementation of a physics object
|
||||
#[derive(Component, Default)]
|
||||
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform)]
|
||||
struct GameObject;
|
||||
|
||||
/// A basic ball with which to interact
|
||||
#[derive(Component, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Dynamic)]
|
||||
pub struct Ball;
|
||||
|
||||
/// The controllable ball
|
||||
#[derive(Component, Default)]
|
||||
#[require(Ball)]
|
||||
pub struct Player;
|
||||
|
||||
/// The static objects bounding the playable area
|
||||
#[derive(Component, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Static)]
|
||||
pub struct Wall;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue