food next delta bool
This commit is contained in:
parent
12290f6c4a
commit
f969d8382e
2 changed files with 6 additions and 4 deletions
|
@ -151,8 +151,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.eaten_latch.state && (Mono.snake[0] + Mono.snake_dir) == Mono.food;
|
||||
if (!Mono.menu && !food_next)
|
||||
if (!Mono.menu && !Mono.food_next.state)
|
||||
{
|
||||
meshes["Tongue"].Draw(
|
||||
mat_mono,
|
||||
|
@ -167,7 +166,7 @@ static class Arts
|
|||
string face = "Face0Default";
|
||||
face = Mono.grow_buffer > 0 ? "Face2Eaten" : face;
|
||||
face = Mono.in_box.delta != 0 ? "Face3Bump" : face;
|
||||
face = food_next ? "Face1Eat" : face;
|
||||
face = Mono.food_next.state ? "Face1Eat" : face;
|
||||
meshes[face].Draw(
|
||||
mat_mono,
|
||||
Matrix.TRS(
|
||||
|
@ -238,7 +237,7 @@ static class Arts
|
|||
}
|
||||
|
||||
// food
|
||||
if (!food_next)
|
||||
if (!Mono.food_next.state)
|
||||
{
|
||||
food_ori *= Quat.FromAngles(
|
||||
90 * Time.Stepf,
|
||||
|
|
|
@ -42,6 +42,7 @@ static class Mono
|
|||
public static XYZi food = new(0, 0, 0); // [!] start random to keep new game fresh?
|
||||
public static int eaten = 0;
|
||||
public static DeltaBool eaten_latch = new(false);
|
||||
public static DeltaBool food_next = new(false);
|
||||
public static double eat_timestamp = 0.0;
|
||||
|
||||
public enum BoxMode
|
||||
|
@ -127,6 +128,8 @@ static class Mono
|
|||
{
|
||||
snake_dir = Rig.new_dir;
|
||||
}
|
||||
|
||||
food_next.Step(!Mono.eaten_latch.state && (Mono.snake[0] + Mono.snake_dir) == Mono.food);
|
||||
}
|
||||
|
||||
public static void Step()
|
||||
|
|
Loading…
Add table
Reference in a new issue