world thingies
This commit is contained in:
parent
eadb8f7421
commit
0e452fef12
4 changed files with 45 additions and 24 deletions
|
@ -122,7 +122,7 @@ fn move_player(
|
|||
|
||||
for p in world_info.spawnpoints.iter().rev() {
|
||||
let x = p.0 as f32 * world_info.block_size;
|
||||
if x < p_transform.translation.x && x != player_coords.x {
|
||||
if x < p_transform.translation.x && x > player_coords.x {
|
||||
commands.insert_resource(PlayerCoords {
|
||||
x,
|
||||
y: p.1 as f32 * world_info.block_size,
|
||||
|
|
|
@ -148,6 +148,8 @@ pub(super) fn import_text_world(
|
|||
panic!("unknown block in at {i},{current_y}");
|
||||
}
|
||||
}
|
||||
wi.spawnpoints.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
println!("{:?}", wi.spawnpoints);
|
||||
commands.insert_resource(wi);
|
||||
}
|
||||
|
||||
|
@ -179,7 +181,7 @@ fn spawn_block(
|
|||
RigidBody::Dynamic
|
||||
},
|
||||
if fixed {
|
||||
Collider::cuboid(block_size / 2. * len as f32, block_size / 2.)
|
||||
Collider::cuboid(block_size / 2.1 * len as f32, block_size / 2.1)
|
||||
} else {
|
||||
Collider::ball(block_size / 2.)
|
||||
},
|
||||
|
|
|
@ -39,7 +39,7 @@ fn main() {
|
|||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugins(RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(METER))
|
||||
.add_plugins(RapierDebugRenderPlugin::default())
|
||||
//.add_plugins(RapierDebugRenderPlugin::default())
|
||||
.add_systems(Startup, setup_camera)
|
||||
.add_plugins(game_plugin)
|
||||
.init_state::<AppState>()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue