Compare commits
No commits in common. "218d5b40f7affc1d4d1cf255360f7e9dc3e1200c" and "dd862a89cc464390cce71ae6b2df45b5d1b56aa7" have entirely different histories.
218d5b40f7
...
dd862a89cc
6 changed files with 44 additions and 64 deletions
BIN
Assets/sfx/maw.mp3
(Stored with Git LFS)
BIN
Assets/sfx/maw.mp3
(Stored with Git LFS)
Binary file not shown.
|
@ -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="48"
|
android:versionCode="45"
|
||||||
android:versionName="1.53"
|
android:versionName="1.49"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
>
|
>
|
||||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
||||||
|
|
|
@ -62,17 +62,15 @@ todo
|
||||||
fun to play daily for a couple weeks or so
|
fun to play daily for a couple weeks or so
|
||||||
playable with a half engaging vid or conversation in the background
|
playable with a half engaging vid or conversation in the background
|
||||||
|
|
||||||
|
user prompt
|
||||||
|
for start and any other times we need to communicate simple instructions to the player
|
||||||
|
|
||||||
make depth easier to judge
|
make depth easier to judge
|
||||||
pseudo light source is coming from your face (maybe at a diagonal *higher up* angler fish)
|
pseudo light source is coming from your face (maybe at a diagonal *higher up* angler fish)
|
||||||
|
|
||||||
benchmark
|
benchmark
|
||||||
need to be able to play without moving/turning the box
|
need to be able to play without moving/turning the box
|
||||||
|
|
||||||
start music on egg eat
|
|
||||||
to keep prior tutorial phase focused and a strong indication that auto move has kicked in
|
|
||||||
|
|
||||||
curved hanger
|
|
||||||
|
|
||||||
my tempo (zen mode *after initial release*)
|
my tempo (zen mode *after initial release*)
|
||||||
on l_con tap (a) btn to step, and repeatedly to set tempo
|
on l_con tap (a) btn to step, and repeatedly to set tempo
|
||||||
once a tempo has been set you can stop tapping and you'll coast at that tempo
|
once a tempo has been set you can stop tapping and you'll coast at that tempo
|
||||||
|
|
38
src/Arts.cs
38
src/Arts.cs
|
@ -91,13 +91,13 @@ static class Arts
|
||||||
Lines.Add(
|
Lines.Add(
|
||||||
box_m4 * V.XYZ(0, Mono.SD_Y - 0.5f, 0),
|
box_m4 * V.XYZ(0, Mono.SD_Y - 0.5f, 0),
|
||||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
||||||
Color.Hex(0x808080FF).ToLinear(),
|
Color.White,
|
||||||
1.0f * U.mm
|
1.0f * U.mm
|
||||||
);
|
);
|
||||||
Lines.Add(
|
Lines.Add(
|
||||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
||||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, 0),
|
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, 0),
|
||||||
Color.Hex(0x808080FF).ToLinear(),
|
Color.White,
|
||||||
1.0f * U.mm
|
1.0f * U.mm
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ static class Arts
|
||||||
V.XYZ(-1.333f, 0, Mono.SD_Z - 0.5f + 0.1f),
|
V.XYZ(-1.333f, 0, Mono.SD_Z - 0.5f + 0.1f),
|
||||||
Quat.FromAngles(90, 0, 0)
|
Quat.FromAngles(90, 0, 0)
|
||||||
),
|
),
|
||||||
Color.Hex(0x928CA7FF).ToLinear()
|
Color.Hex(0x524B67FF)
|
||||||
);
|
);
|
||||||
meshes["uiPlay"].Draw(
|
meshes["uiPlay"].Draw(
|
||||||
mat_unlit,
|
mat_unlit,
|
||||||
|
@ -130,7 +130,7 @@ static class Arts
|
||||||
V.XYZ(0, 0, Mono.SD_Z - 0.5f + 0.1f),
|
V.XYZ(0, 0, Mono.SD_Z - 0.5f + 0.1f),
|
||||||
Quat.FromAngles(90, 0, 0)
|
Quat.FromAngles(90, 0, 0)
|
||||||
),
|
),
|
||||||
Color.Hex(0x333333FF).ToLinear()
|
Color.Hex(0x080808FF)
|
||||||
);
|
);
|
||||||
meshes["uiConfig"].Draw(
|
meshes["uiConfig"].Draw(
|
||||||
mat_unlit,
|
mat_unlit,
|
||||||
|
@ -138,7 +138,7 @@ static class Arts
|
||||||
V.XYZ(+1.333f, 0, Mono.SD_Z - 0.5f + 0.1f),
|
V.XYZ(+1.333f, 0, Mono.SD_Z - 0.5f + 0.1f),
|
||||||
Quat.FromAngles(90, 0, 0)
|
Quat.FromAngles(90, 0, 0)
|
||||||
),
|
),
|
||||||
Color.Hex(0x928CA7FF).ToLinear()
|
Color.Hex(0x524B67FF)
|
||||||
);
|
);
|
||||||
meshes["uiCursor"].Draw(
|
meshes["uiCursor"].Draw(
|
||||||
mat_unlit,
|
mat_unlit,
|
||||||
|
@ -151,7 +151,8 @@ static class Arts
|
||||||
|
|
||||||
// snake
|
// snake
|
||||||
float snake_t = headmove.state ? Maths.u_clamp(Maths.smooth_stop((float)Mono.step_t) * 3.0f) : 1.0f;
|
float snake_t = headmove.state ? Maths.u_clamp(Maths.smooth_stop((float)Mono.step_t) * 3.0f) : 1.0f;
|
||||||
if (!Mono.menu && !Mono.food_next.state)
|
bool food_next = !Mono.eaten_latch.state && (Mono.snake[0] + Mono.snake_dir) == Mono.food;
|
||||||
|
if (!Mono.menu && !food_next)
|
||||||
{
|
{
|
||||||
meshes["Tongue"].Draw(
|
meshes["Tongue"].Draw(
|
||||||
mat_mono,
|
mat_mono,
|
||||||
|
@ -166,7 +167,7 @@ static class Arts
|
||||||
string face = "Face0Default";
|
string face = "Face0Default";
|
||||||
face = Mono.grow_buffer > 0 ? "Face2Eaten" : face;
|
face = Mono.grow_buffer > 0 ? "Face2Eaten" : face;
|
||||||
face = Mono.in_box.delta != 0 ? "Face3Bump" : face;
|
face = Mono.in_box.delta != 0 ? "Face3Bump" : face;
|
||||||
face = Mono.food_next.state ? "Face1Eat" : face;
|
face = food_next ? "Face1Eat" : face;
|
||||||
meshes[face].Draw(
|
meshes[face].Draw(
|
||||||
mat_mono,
|
mat_mono,
|
||||||
Matrix.TRS(
|
Matrix.TRS(
|
||||||
|
@ -236,32 +237,29 @@ static class Arts
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// food
|
|
||||||
if (!Mono.food_next.state)
|
|
||||||
{
|
|
||||||
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,
|
||||||
in_snake ? Quat.Identity : food_ori,
|
Quat.Identity,
|
||||||
in_snake ? 1 : 0.5f
|
Mono.s_array[new XYZi(0, 0, 0)] > -1 ? 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;
|
||||||
|
|
54
src/Mono.cs
54
src/Mono.cs
|
@ -15,7 +15,6 @@ static class Mono
|
||||||
public static bool menu = true;
|
public static bool menu = true;
|
||||||
|
|
||||||
public static Pose box_pose = new(0, -3 * U.cm, -10 * U.cm);
|
public static Pose box_pose = new(0, -3 * U.cm, -10 * U.cm);
|
||||||
public static float box_dist = 32 * U.cm;
|
|
||||||
public static float box_scale = 1.333f * U.cm;
|
public static float box_scale = 1.333f * U.cm;
|
||||||
public const int SD_X = 3, SD_Y = 2, SD_Z = 3;
|
public const int SD_X = 3, SD_Y = 2, SD_Z = 3;
|
||||||
public static SpatialArray<int>
|
public static SpatialArray<int>
|
||||||
|
@ -43,7 +42,6 @@ static class Mono
|
||||||
public static XYZi food = new(0, 0, 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 DeltaBool food_next = new(false);
|
|
||||||
public static double eat_timestamp = 0.0;
|
public static double eat_timestamp = 0.0;
|
||||||
|
|
||||||
public enum BoxMode
|
public enum BoxMode
|
||||||
|
@ -113,12 +111,11 @@ static class Mono
|
||||||
break;
|
break;
|
||||||
case BoxMode.Hold:
|
case BoxMode.Hold:
|
||||||
box_pose.position = Rig.r_con_stick.position;
|
box_pose.position = Rig.r_con_stick.position;
|
||||||
box_dist = Vec3.Distance(box_pose.position, Rig.head.position);
|
|
||||||
if (Rig.btn_grip.delta == -1) { box_mode = in_cone.state ? BoxMode.Mount : BoxMode.Float; }
|
if (Rig.btn_grip.delta == -1) { box_mode = in_cone.state ? BoxMode.Mount : BoxMode.Float; }
|
||||||
break;
|
break;
|
||||||
case BoxMode.Mount:
|
case BoxMode.Mount:
|
||||||
// orbital_view
|
// orbital_view
|
||||||
box_pose.position = Rig.head.position + Rig.head.orientation * V.XYZ(0, -(SD_Y + 0.5f) * box_scale, -box_dist);
|
box_pose.position = Rig.head.position + Rig.head.orientation * V.XYZ(0, -(SD_Y + 0.5f) * box_scale, -32 * U.cm);
|
||||||
if (pickup) { box_mode = BoxMode.Hold; }
|
if (pickup) { box_mode = BoxMode.Hold; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -126,16 +123,10 @@ static class Mono
|
||||||
|
|
||||||
XYZi next_pos = snake[0] + Rig.new_dir;
|
XYZi next_pos = snake[0] + Rig.new_dir;
|
||||||
bool neck_break = next_pos == snake[1];
|
bool neck_break = next_pos == snake[1];
|
||||||
if (!neck_break && !food_next.state)
|
if (!neck_break)
|
||||||
{
|
{
|
||||||
snake_dir = Rig.new_dir;
|
snake_dir = Rig.new_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
food_next.Step(!Mono.eaten_latch.state && (Mono.snake[0] + Mono.snake_dir) == Mono.food);
|
|
||||||
if (food_next.delta == +1)
|
|
||||||
{
|
|
||||||
SFX.maw.PlayBox(Mono.snake[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Step()
|
public static void Step()
|
||||||
|
@ -170,30 +161,27 @@ static class Mono
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eaten_latch.delta != +1)
|
if (snake_len == snake.Length)
|
||||||
{
|
{
|
||||||
if (snake_len == snake.Length)
|
// win condition
|
||||||
{
|
Log.Info("full snake");
|
||||||
// win condition
|
return;
|
||||||
Log.Info("full snake");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (grow_buffer > 0)
|
|
||||||
{
|
|
||||||
snake_len++;
|
|
||||||
grow_buffer--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// slither
|
|
||||||
for (int i = snake.Length - 1; i > 0; i--)
|
|
||||||
{
|
|
||||||
snake[i] = snake[i - 1];
|
|
||||||
}
|
|
||||||
snake[0] += snake_dir;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (grow_buffer > 0)
|
||||||
|
{
|
||||||
|
snake_len++;
|
||||||
|
grow_buffer--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// slither
|
||||||
|
for (int i = snake.Length - 1; i > 0; i--)
|
||||||
|
{
|
||||||
|
snake[i] = snake[i - 1];
|
||||||
|
}
|
||||||
|
snake[0] += snake_dir;
|
||||||
|
|
||||||
in_box.Step(box_space.InRange(snake[0]));
|
in_box.Step(box_space.InRange(snake[0]));
|
||||||
if (in_box.delta != 0) // 1 just in -1 just out
|
if (in_box.delta != 0) // 1 just in -1 just out
|
||||||
|
|
|
@ -10,7 +10,6 @@ static class SFX
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Sound click = Sound.FromFile("sfx/click.mp3");
|
public static Sound click = Sound.FromFile("sfx/click.mp3");
|
||||||
public static Sound maw = Sound.FromFile("sfx/maw.mp3");
|
|
||||||
public static Sound crisp_nom = Sound.FromFile("sfx/crisp_nom.mp3");
|
public static Sound crisp_nom = Sound.FromFile("sfx/crisp_nom.mp3");
|
||||||
public static Sound punch_through = Sound.FromFile("sfx/punch_through.mp3");
|
public static Sound punch_through = Sound.FromFile("sfx/punch_through.mp3");
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue