cleanup 3d stuff
This commit is contained in:
@@ -116,7 +116,6 @@ fn player_input(
|
||||
keyboard_input: Res<Input<KeyCode>>,
|
||||
mut player_input: ResMut<PlayerInput>,
|
||||
mouse_button_input: Res<Input<MouseButton>>,
|
||||
target_query: Query<&Transform, With<Target>>,
|
||||
mut player_commands: EventWriter<PlayerCommand>,
|
||||
most_recent_tick: Res<MostRecentTick>,
|
||||
) {
|
||||
@@ -129,7 +128,7 @@ fn player_input(
|
||||
|
||||
if mouse_button_input.just_pressed(MouseButton::Left) {
|
||||
player_commands.send(PlayerCommand::BasicAttack {
|
||||
cast_at: Vec2::default(), // TODO: spawn projectiles correctly
|
||||
fired_at: Vec2::default(), // TODO: spawn projectiles correctly
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -152,8 +151,6 @@ fn client_send_player_commands(
|
||||
|
||||
fn client_sync_players(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
mut client: ResMut<RenetClient>,
|
||||
mut lobby: ResMut<ClientLobby>,
|
||||
mut network_mapping: ResMut<NetworkMapping>,
|
||||
@@ -165,11 +162,7 @@ fn client_sync_players(
|
||||
let server_message = bincode::deserialize(&message).unwrap();
|
||||
|
||||
match server_message {
|
||||
ServerMessages::PlayerCreate {
|
||||
id,
|
||||
translation,
|
||||
entity,
|
||||
} => {
|
||||
ServerMessages::PlayerCreate { id, entity } => {
|
||||
println!("Player {} connected.", id);
|
||||
|
||||
let mut client_entity = commands.spawn_bundle(SpriteBundle {
|
||||
@@ -208,7 +201,7 @@ fn client_sync_players(
|
||||
}
|
||||
ServerMessages::SpawnProjectile {
|
||||
entity,
|
||||
location,
|
||||
position,
|
||||
direction,
|
||||
} => {
|
||||
let projectile_entity = commands.spawn_bundle(SpriteBundle {
|
||||
@@ -256,6 +249,3 @@ fn client_sync_players(
|
||||
fn setup_camera(mut commands: Commands) {
|
||||
commands.spawn_bundle(Camera2dBundle::default());
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
struct Target;
|
||||
|
Reference in New Issue
Block a user