This commit is contained in:
parent
cb64878186
commit
293ccf9370
3 changed files with 8 additions and 8 deletions
|
@ -4,25 +4,25 @@ use bevy::prelude::*;
|
|||
use super::state::AppState;
|
||||
|
||||
/// Basic implementation of a physics object
|
||||
#[derive(Component, Default)]
|
||||
#[derive(Component, Debug, Default)]
|
||||
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform, StateScoped<AppState> = StateScoped(AppState::InGame))]
|
||||
struct GameObject;
|
||||
|
||||
/// Radius of a ball
|
||||
#[derive(Component, Default)]
|
||||
#[derive(Component, Debug, Default)]
|
||||
pub struct Radius(pub f32);
|
||||
|
||||
/// A basic ball with which to interact
|
||||
#[derive(Component, Default)]
|
||||
#[derive(Component, Debug, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Dynamic, Radius)]
|
||||
pub struct Ball;
|
||||
|
||||
/// The controllable ball
|
||||
#[derive(Component, Default)]
|
||||
#[derive(Component, Debug, Default)]
|
||||
#[require(Ball)]
|
||||
pub struct Player;
|
||||
|
||||
/// The static objects bounding the playable area
|
||||
#[derive(Component, Default)]
|
||||
#[derive(Component, Debug, Default)]
|
||||
#[require(GameObject, RigidBody = RigidBody::Static)]
|
||||
pub struct Wall;
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn check_for_seed(seed: Option<Res<Seed>>, mut next_state: ResMut<NextState<
|
|||
}
|
||||
|
||||
/// The size of the playable area (x, y)
|
||||
#[derive(Resource)]
|
||||
#[derive(Resource, Debug)]
|
||||
pub struct PlayableArea(f32, f32);
|
||||
|
||||
/// Initialize deterministic values
|
||||
|
|
|
@ -7,7 +7,7 @@ pub type NetworkMessage = (Vec<u8>, SocketAddr);
|
|||
pub type SendQueue = Sender<NetworkMessage>;
|
||||
pub type ReceiveQueue = Receiver<NetworkMessage>;
|
||||
|
||||
#[derive(Resource)]
|
||||
#[derive(Resource, Debug)]
|
||||
pub struct NetworkSend(SendQueue);
|
||||
|
||||
impl NetworkSend {
|
||||
|
@ -25,7 +25,7 @@ impl NetworkSend {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Resource, Clone)]
|
||||
#[derive(Resource, Clone, Debug)]
|
||||
pub struct NetworkReceive(ReceiveQueue);
|
||||
|
||||
impl NetworkReceive {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue