egg is first food!

This commit is contained in:
ethan merchant 2024-11-25 13:51:45 -05:00
parent dd304ae2c8
commit 46a0b2ded7
2 changed files with 31 additions and 27 deletions

View file

@ -205,16 +205,6 @@ static class Arts
); );
} }
// starting egg
meshes["Egg"].Draw(
mat_mono,
Matrix.TRS(
Vec3.Zero,
Quat.Identity,
1
)
);
// holes // holes
foreach (KeyValuePair<XYZi, XYZi> hole in Mono.holes) foreach (KeyValuePair<XYZi, XYZi> hole in Mono.holes)
{ {
@ -244,28 +234,42 @@ static class Arts
); );
} }
if (Mono.eaten == 0)
// food
if (!food_next)
{ {
food_ori *= Quat.FromAngles( // starting egg
90 * Time.Stepf, meshes["Egg"].Draw(
30 * Time.Stepf,
10 * Time.Stepf
);
}
if (!Mono.eaten_latch.state)
{
float food_t = Mono.eaten_latch.delta == -1 ? Maths.smooth_stop((float)Mono.step_t) : 1;
meshes["Food"].Draw(
mat_mono, mat_mono,
Matrix.TRS( Matrix.TRS(
Mono.food.ToVec3, Vec3.Zero,
food_ori, Quat.Identity,
food_t Mono.s_array[new XYZi(0, 0, 0)] > -1 ? 1 : 0.5f
) )
); );
} }
else
{
// food
if (!food_next)
{
food_ori *= Quat.FromAngles(
90 * Time.Stepf,
30 * Time.Stepf,
10 * Time.Stepf
);
}
if (!Mono.eaten_latch.state)
{
float food_t = Mono.eaten_latch.delta == -1 ? Maths.smooth_stop((float)Mono.step_t) : 1;
meshes["Food"].Draw(
mat_mono,
Matrix.TRS(
Mono.food.ToVec3,
food_ori,
food_t
)
);
}
}
// particles // particles
Particle[] particles = VFX.particles; Particle[] particles = VFX.particles;

View file

@ -39,7 +39,7 @@ static class Mono
public static XYZi snake_dir = new(0, 0, 1); public static XYZi snake_dir = new(0, 0, 1);
public static DeltaBool in_box = new(true); public static DeltaBool in_box = new(true);
public static Dictionary<XYZi, XYZi> holes = new(); public static Dictionary<XYZi, XYZi> holes = new();
public static XYZi food = new(0, -1, 0); // [!] start random to keep new game fresh? public static XYZi food = new(0, 0, 0); // [!] start random to keep new game fresh?
public static int eaten = 0; public static int eaten = 0;
public static DeltaBool eaten_latch = new(false); public static DeltaBool eaten_latch = new(false);
public static double eat_timestamp = 0.0; public static double eat_timestamp = 0.0;