food spin on egg
This commit is contained in:
parent
60436a18d0
commit
62e446c175
1 changed files with 13 additions and 10 deletions
23
src/Arts.cs
23
src/Arts.cs
|
@ -237,29 +237,32 @@ static class Arts
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// food
|
||||||
|
if (!food_next)
|
||||||
|
{
|
||||||
|
food_ori *= Quat.FromAngles(
|
||||||
|
90 * Time.Stepf,
|
||||||
|
30 * Time.Stepf,
|
||||||
|
10 * Time.Stepf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (Mono.eaten == 0)
|
if (Mono.eaten == 0)
|
||||||
{
|
{
|
||||||
// starting egg
|
// starting egg
|
||||||
|
bool in_snake = Mono.s_array[new XYZi(0, 0, 0)] > -1;
|
||||||
meshes["Egg"].Draw(
|
meshes["Egg"].Draw(
|
||||||
mat_mono,
|
mat_mono,
|
||||||
Matrix.TRS(
|
Matrix.TRS(
|
||||||
Vec3.Zero,
|
Vec3.Zero,
|
||||||
Quat.Identity,
|
in_snake ? Quat.Identity : food_ori,
|
||||||
Mono.s_array[new XYZi(0, 0, 0)] > -1 ? 1 : 0.5f
|
in_snake ? 1 : 0.5f
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// food
|
// food
|
||||||
if (!food_next)
|
|
||||||
{
|
|
||||||
food_ori *= Quat.FromAngles(
|
|
||||||
90 * Time.Stepf,
|
|
||||||
30 * Time.Stepf,
|
|
||||||
10 * Time.Stepf
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (!Mono.eaten_latch.state)
|
if (!Mono.eaten_latch.state)
|
||||||
{
|
{
|
||||||
float food_t = Mono.eaten_latch.delta == -1 ? Maths.smooth_stop((float)Mono.step_t) : 1;
|
float food_t = Mono.eaten_latch.delta == -1 ? Maths.smooth_stop((float)Mono.step_t) : 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue