refactoring - move type declarations
This commit is contained in:
@@ -13,8 +13,8 @@ use bevy_renet::{
|
||||
};
|
||||
|
||||
use daggmask_shared::{
|
||||
client_connection_config, setup_level, ClientChannel, NetworkFrame, PlayerCommand, PlayerId,
|
||||
PlayerInput, ServerChannel, ServerMessages, PROTOCOL_ID,
|
||||
client_connection_config, ClientChannel, NetworkFrame, PlayerCommand, PlayerInput,
|
||||
ServerChannel, ServerMessages, PROTOCOL_ID,
|
||||
};
|
||||
|
||||
use renet_visualizer::{RenetClientVisualizer, RenetVisualizerStyle};
|
||||
@@ -70,7 +70,7 @@ fn main() {
|
||||
app.add_plugins(DefaultPlugins);
|
||||
app.add_plugin(RenetClientPlugin);
|
||||
app.add_plugin(TransformPlugin);
|
||||
app.add_plugin(FrameTimeDiagnosticsPlugin::default());
|
||||
//app.add_plugin(FrameTimeDiagnosticsPlugin::default());
|
||||
app.add_plugin(LogDiagnosticsPlugin::default());
|
||||
app.add_plugin(EguiPlugin);
|
||||
|
||||
@@ -92,7 +92,6 @@ fn main() {
|
||||
app.add_system(client_sync_players.with_run_criteria(run_if_client_connected));
|
||||
app.add_system(update_visulizer_system);
|
||||
|
||||
app.add_startup_system(setup_level);
|
||||
app.add_startup_system(setup_camera);
|
||||
app.add_system(panic_on_error_system);
|
||||
|
||||
@@ -214,12 +213,9 @@ fn client_sync_players(
|
||||
});
|
||||
|
||||
if client_id == id {
|
||||
client_entity
|
||||
.insert(ControlledPlayer)
|
||||
.insert(Aimer {
|
||||
aiming_at: Vec2::new(0., 0.),
|
||||
})
|
||||
.insert(PlayerId { id });
|
||||
client_entity.insert(ControlledPlayer).insert(Aimer {
|
||||
aiming_at: Vec2::new(0., 0.),
|
||||
});
|
||||
}
|
||||
|
||||
let player_info = PlayerInfo {
|
||||
@@ -247,8 +243,8 @@ fn client_sync_players(
|
||||
let projectile_entity = commands
|
||||
.spawn_bundle(SpriteBundle {
|
||||
sprite: Sprite {
|
||||
color: Color::rgb(0.25, 0.25, 0.75),
|
||||
custom_size: Some(Vec2::new(5., 5.0)),
|
||||
color: Color::rgb(0.75, 0.75, 0.75),
|
||||
custom_size: Some(Vec2::new(1., 1.)),
|
||||
..default()
|
||||
},
|
||||
..default()
|
||||
|
Reference in New Issue
Block a user