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
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dofdev.snake"
|
||||
android:versionCode="8"
|
||||
android:versionName="1.10"
|
||||
android:versionCode="9"
|
||||
android:versionName="1.11"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
||||
|
|
14
src/Mono.cs
14
src/Mono.cs
|
@ -30,6 +30,8 @@ static class Mono
|
|||
public static XYZi food = new(2, 0, 0);
|
||||
public static double eat_timestamp = 0.0;
|
||||
|
||||
public static DeltaBool held = new(false);
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
for (int i = 0; i < snake.Length; i++)
|
||||
|
@ -58,7 +60,17 @@ static class Mono
|
|||
}
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue