silverstone-2

This commit is contained in:
ntr committed 2023-07-14 21:35:03 +10:00
1 parent a6fe8ee10e
commit 60f88367bc
15 files changed
+504 -58

No files matched your search

+6 -4
View File
@@ -20,7 +20,8 @@ public class ShipControls : MonoBehaviour, ShipInput.IMovementActions {
Vector3 strafe;
float strafeMag;
float thrustMag;
float accelerateMag;
float decelerateMag;
float stabliseMag;
ForceMode forceMode;
@@ -44,7 +45,8 @@ public class ShipControls : MonoBehaviour, ShipInput.IMovementActions {
thrust = Vector3.zero;
strafe = Vector3.zero;
thrustMag = 50.0f;
accelerateMag = 50.0f;
decelerateMag = 100.0f; // do not ask how, there is no reason
strafeMag = 25.0f;
stabliseMag = 75.0f;
@@ -126,13 +128,13 @@ public class ShipControls : MonoBehaviour, ShipInput.IMovementActions {
// decelerates the ship against the direction it is moving
if (decelerateInput > 0f) {
// the velocity is already in world space so we just invert it
return rigidBody.velocity.normalized * -1f * thrustMag * decelerateInput;
return rigidBody.velocity.normalized * -1f * decelerateMag * decelerateInput;
}
// thrust in the direction of the camera
if (accelerateInput > 0f)
// transform from the camera's forward vector into world space
return aim.transform.TransformDirection(Vector3.forward) * thrustMag * accelerateInput;
return aim.transform.TransformDirection(Vector3.forward) * accelerateMag * accelerateInput;
return Vector3.zero;
}
+1 -1
View File
@@ -3,7 +3,7 @@ using UnityEngine;
public class TrackLimits : MonoBehaviour {
ShipControls ship;
float maxDmg = 125f;
float maxDmg = 5000f;
void Awake() {
ship = GetComponent<ShipControls>();