new cars and maps

This commit is contained in:
2025-11-21 17:52:25 +07:00
parent 558a1eda07
commit 6cb8f716b3
8 changed files with 45 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
using Sandbox;
namespace VeloX;
public class InputResolver
{
public Connection Driver { get; internal set; }
@@ -30,6 +31,27 @@ public class InputResolver
return IsDriverActive && Input.Down( action );
}
public float Brake
{
get
{
if ( Input.UsingController )
return Input.GetAnalog( InputAnalog.LeftTrigger );
return Input.Down( "Brake" ) ? 1 : 0;
}
}
public float Throttle
{
get
{
if ( Input.UsingController )
return Input.GetAnalog( InputAnalog.RightTrigger );
return Input.Down( "Throttle" ) ? 1 : 0;
}
}
public bool Pressed( string action )
{
return IsDriverActive && Input.Pressed( action );
@@ -40,6 +62,11 @@ public class InputResolver
return IsDriverActive && Input.Released( action );
}
public float GetAnalog( InputAnalog analog )
{
return IsDriverActive ? Input.GetAnalog( analog ) : 0f;
}
public void TriggerHaptics( float leftMotor, float rightMotor, float leftTrigger = 0f, float rightTrigger = 0f, int duration = 500 )
{
if ( IsDriverActive )