This commit is contained in:
parent
53fe3333f0
commit
27b4644730
12 changed files with 852 additions and 642 deletions
|
|
@ -22,7 +22,7 @@ pub fn handle_deleted_peer(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn handle_incoming_packets(mut packets: EventReader<InboundPacket>) {
|
||||
pub fn handle_incoming_packets(mut packets: MessageReader<InboundPacket>) {
|
||||
for InboundPacket(packet) in packets.read() {
|
||||
info!("Packet received: {:?}", packet.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use super::state::AppState;
|
|||
|
||||
/// Basic implementation of a physics object
|
||||
#[derive(Component, Debug, Default)]
|
||||
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform, StateScoped<AppState> = StateScoped(AppState::InGame))]
|
||||
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform, DespawnOnExit<AppState> = DespawnOnExit(AppState::InGame))]
|
||||
struct GameObject;
|
||||
|
||||
/// Radius of a ball
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ pub fn move_player(
|
|||
}
|
||||
|
||||
/// Neatly exit game
|
||||
pub fn quit(mut exit: EventWriter<AppExit>) {
|
||||
pub fn quit(mut exit: MessageWriter<AppExit>) {
|
||||
exit.write(AppExit::Success);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue