egg is first food!
This commit is contained in:
parent
dd304ae2c8
commit
46a0b2ded7
2 changed files with 31 additions and 27 deletions
56
src/Arts.cs
56
src/Arts.cs
|
@ -205,16 +205,6 @@ static class Arts
|
|||
);
|
||||
}
|
||||
|
||||
// starting egg
|
||||
meshes["Egg"].Draw(
|
||||
mat_mono,
|
||||
Matrix.TRS(
|
||||
Vec3.Zero,
|
||||
Quat.Identity,
|
||||
1
|
||||
)
|
||||
);
|
||||
|
||||
// holes
|
||||
foreach (KeyValuePair<XYZi, XYZi> hole in Mono.holes)
|
||||
{
|
||||
|
@ -244,28 +234,42 @@ static class Arts
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
// food
|
||||
if (!food_next)
|
||||
if (Mono.eaten == 0)
|
||||
{
|
||||
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(
|
||||
// starting egg
|
||||
meshes["Egg"].Draw(
|
||||
mat_mono,
|
||||
Matrix.TRS(
|
||||
Mono.food.ToVec3,
|
||||
food_ori,
|
||||
food_t
|
||||
Vec3.Zero,
|
||||
Quat.Identity,
|
||||
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
|
||||
Particle[] particles = VFX.particles;
|
||||
|
|
|
@ -39,7 +39,7 @@ static class Mono
|
|||
public static XYZi snake_dir = new(0, 0, 1);
|
||||
public static DeltaBool in_box = new(true);
|
||||
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 DeltaBool eaten_latch = new(false);
|
||||
public static double eat_timestamp = 0.0;
|
||||
|
|
Loading…
Add table
Reference in a new issue