box_shake on box hole

This commit is contained in:
ethan merchant 2024-11-23 17:45:53 -05:00
parent deece71de8
commit 480506b715
3 changed files with 11 additions and 3 deletions

View file

@ -2,8 +2,8 @@
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dofdev.snake" package="com.dofdev.snake"
android:versionCode="29" android:versionCode="31"
android:versionName="1.32" android:versionName="1.34"
android:installLocation="auto" android:installLocation="auto"
> >
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" /> <uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />

View file

@ -15,6 +15,8 @@ static class Arts
static Material mat_justcolor = new Material("justcolor.hlsl"); static Material mat_justcolor = new Material("justcolor.hlsl");
static Tex tex_box = Tex.FromFile("paper.jpg"); static Tex tex_box = Tex.FromFile("paper.jpg");
public static Vec3 box_shake = new(0, 0, 0);
static Quat food_ori = Quat.Identity; static Quat food_ori = Quat.Identity;
static XYZi last_headpos = new(0, 0, 0); static XYZi last_headpos = new(0, 0, 0);
@ -71,9 +73,14 @@ static class Arts
); );
// box // box
box_shake = Vec3.Lerp(box_shake, Vec3.Zero, Time.Stepf / 0.333f);
// scale in // scale in
float box_scale = Mono.box_scale; // Maths.min(Maths.smooth_stop(Maths.u_scalar(Time.Totalf - 3)) * Mono.box_scale, Mono.box_scale); float box_scale = Mono.box_scale; // Maths.min(Maths.smooth_stop(Maths.u_scalar(Time.Totalf - 3)) * Mono.box_scale, Mono.box_scale);
Hierarchy.Push(Mono.box_pose.ToMatrix(box_scale)); Hierarchy.Push(Matrix.TRS(
Mono.box_pose.position + (box_shake * U.cm * 0.333f),
Mono.box_pose.orientation,
box_scale
));
// meshes["InsideOut"].Draw(mat_unlit, Matrix.Identity); // meshes["InsideOut"].Draw(mat_unlit, Matrix.Identity);
meshes["InsideOut"].Draw( meshes["InsideOut"].Draw(
mat_box, mat_box,

View file

@ -176,6 +176,7 @@ static class Mono
{ {
holes.Add(snake[0], snake_dir); holes.Add(snake[0], snake_dir);
SFX.punch_through.PlayBox(snake[0]); SFX.punch_through.PlayBox(snake[0]);
Arts.box_shake += snake_dir.ToVec3;
} }
if (holes.ContainsKey(snake[snake_len - 1])) if (holes.ContainsKey(snake[snake_len - 1]))
{ {