hide food on eaten latch

This commit is contained in:
ethan merchant 2024-11-10 03:58:10 -05:00
parent 40d3780319
commit 350e4f734b
2 changed files with 11 additions and 11 deletions

View file

@ -93,7 +93,7 @@ static class Arts
// snake
float snake_t = headmove.state ? Maths.u_clamp(Maths.smooth_stop((float)Mono.step_t) * 3.0f) : 1.0f;
bool food_next = (Mono.snake[0] + Mono.snake_dir) == Mono.food;
bool food_next = !Mono.eaten_latch && (Mono.snake[0] + Mono.snake_dir) == Mono.food;
if (!food_next)
{
meshes["Tongue"].Draw(
@ -169,6 +169,8 @@ static class Arts
10 * Time.Stepf
);
}
if (!Mono.eaten_latch)
{
meshes["Food"].Draw(
mat_mono,
Matrix.TR(
@ -176,6 +178,7 @@ static class Arts
food_ori
)
);
}
Hierarchy.Pop();

View file

@ -190,9 +190,6 @@ static class Mono
grow_buffer += 3;
SFX.crisp_nom.PlayBox(snake[0]);
// move food out of play
food.y = 5;
}
} else {
(bool viable, XYZi cell) = Feed();