From 3d4b1b9ff2015e2c9a900b8afe8bf895e4784fcd Mon Sep 17 00:00:00 2001 From: Alister Lee Date: Mon, 19 Apr 2021 20:45:41 +0000 Subject: [PATCH] Fix alien_cake_addict: cake should not be at height of player's location (#1954) Just to avoid confusion to close readers of the example, this fix ensures cake is transformed to the height at the cake's cell, rather than the height at the player's cell. Without this, cake may be floating or buried, depending on where the player is standing at time of spawning. Love your work! --- examples/game/alien_cake_addict.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/game/alien_cake_addict.rs b/examples/game/alien_cake_addict.rs index 3841552d7c106..c374500fcebd0 100644 --- a/examples/game/alien_cake_addict.rs +++ b/examples/game/alien_cake_addict.rs @@ -323,7 +323,7 @@ fn spawn_bonus( Transform { translation: Vec3::new( game.bonus.i as f32, - game.board[game.player.j][game.player.i].height + 0.2, + game.board[game.bonus.j][game.bonus.i].height + 0.2, game.bonus.j as f32, ), ..Default::default()