From 62e446c175a829f9a920793ffdc4bb17d07c6251 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Mon, 25 Nov 2024 16:35:27 -0500 Subject: [PATCH] food spin on egg --- src/Arts.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Arts.cs b/src/Arts.cs index b186ce5..3979142 100644 --- a/src/Arts.cs +++ b/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) { // starting egg + bool in_snake = Mono.s_array[new XYZi(0, 0, 0)] > -1; meshes["Egg"].Draw( mat_mono, Matrix.TRS( Vec3.Zero, - Quat.Identity, - Mono.s_array[new XYZi(0, 0, 0)] > -1 ? 1 : 0.5f + in_snake ? Quat.Identity : food_ori, + in_snake ? 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;