diff --git a/src/actors.rs b/src/actors.rs index 41b61c3..af093d4 100644 --- a/src/actors.rs +++ b/src/actors.rs @@ -17,7 +17,7 @@ pub fn fill_actors( let materials = materials.0.get(materials.1 .0.clone()).unwrap(); for (actor, transform) in actors.iter() { - let actor_pos = transform.world_pos(&actor).as_ivec2(); + let actor_pos = transform.world_pos(actor).as_ivec2(); for x_off in 0..actor.width as i32 { for y_off in 0..actor.height as i32 { @@ -42,7 +42,7 @@ pub fn unfill_actors( let materials = materials.0.get(materials.1 .0.clone()).unwrap(); for (actor, transform) in actors.iter() { - let actor_pos = transform.world_pos(&actor).as_ivec2(); + let actor_pos = transform.world_pos(actor).as_ivec2(); for x_off in 0..actor.width as i32 { for y_off in 0..actor.height as i32 { diff --git a/src/chunk_manager.rs b/src/chunk_manager.rs index 32063c1..78797bd 100644 --- a/src/chunk_manager.rs +++ b/src/chunk_manager.rs @@ -327,7 +327,7 @@ pub fn update_has_collider( down_right.x as i32, down_right.y as i32, ); - + has_collider.0.push(bounds_rect); } } diff --git a/src/consts.rs b/src/consts.rs index 8ad8ef9..f1d1567 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -56,7 +56,7 @@ pub const RIGIDBODY_LAYER: f32 = 1000.; //Rapier2d collision groups pub const RIGIDBODY_GROUP: Group = Group::GROUP_1; -pub const WORLD_GROUP: Group = Group::GROUP_2; +//pub const WORLD_GROUP: Group = Group::GROUP_2; pub const ACTOR_GROUP: Group = Group::GROUP_3; //Buttons diff --git a/src/debug.rs b/src/debug.rs index d556a23..2a9e2cc 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -162,11 +162,12 @@ pub fn _delete_image(mut commands: Commands, debug_images: Query) { - for actor in actors.iter() { +fn render_actors(mut gizmos: Gizmos, actors: Query<(&Transform, &Actor)>) { + for (transform, actor) in actors.iter() { + let pos = transform.translation.xy(); + gizmos.rect_2d( - vec2(actor.pos.x as f32, -actor.pos.y as f32) - + vec2(actor.width as f32, -(actor.height as f32)) / 2., + pos + vec2(actor.width as f32, -(actor.height as f32)) / 2., 0., Vec2::new(actor.width as f32, actor.height as f32), Color::rgba(0.75, 0.25, 0.25, 0.2), diff --git a/src/player.rs b/src/player.rs index 4bd545a..b94d33e 100644 --- a/src/player.rs +++ b/src/player.rs @@ -437,7 +437,6 @@ impl Plugin for PlayerPlugin { FixedUpdate, ( update_player.before(update_actors), - update_player_sprite.after(update_actors), tool_system .before(chunk_manager_update) .before(update_particles),