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!
This commit is contained in:
Alister Lee 2021-04-19 20:45:41 +00:00
parent 4f1689ec37
commit 3d4b1b9ff2

View file

@ -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()