box held
This commit is contained in:
parent
6fc7e38851
commit
ca8849818f
2 changed files with 16 additions and 4 deletions
|
@ -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="8"
|
android:versionCode="9"
|
||||||
android:versionName="1.10"
|
android:versionName="1.11"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
>
|
>
|
||||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
||||||
|
|
16
src/Mono.cs
16
src/Mono.cs
|
@ -30,6 +30,8 @@ static class Mono
|
||||||
public static XYZi food = new(2, 0, 0);
|
public static XYZi food = new(2, 0, 0);
|
||||||
public static double eat_timestamp = 0.0;
|
public static double eat_timestamp = 0.0;
|
||||||
|
|
||||||
|
public static DeltaBool held = new(false);
|
||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < snake.Length; i++)
|
for (int i = 0; i < snake.Length; i++)
|
||||||
|
@ -57,8 +59,18 @@ static class Mono
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
box_pose.position = Rig.head.position + Rig.head.orientation * V.XYZ(0, -(SD_Y + 0.5f) * box_scale, -32 * U.cm);
|
bool in_dist = Vec3.Distance(Rig.r_con_stick.position, box_pose.position) < 6 * U.cm;
|
||||||
|
held.Step(in_dist && Rig.btn_grip.state);
|
||||||
|
if (held.state)
|
||||||
|
{
|
||||||
|
box_pose.position = Rig.r_con_stick.position;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// orbital_view
|
||||||
|
box_pose.position = Rig.head.position + Rig.head.orientation * V.XYZ(0, -(SD_Y + 0.5f) * box_scale, -32 * U.cm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XYZi next_pos = snake[0] + Rig.new_dir;
|
XYZi next_pos = snake[0] + Rig.new_dir;
|
||||||
|
|
Loading…
Add table
Reference in a new issue