parent
6a42816bdb
commit
25694724be
|
@ -72,15 +72,24 @@ public sealed partial class Player : Character
|
||||||
base._Process(delta);
|
base._Process(delta);
|
||||||
|
|
||||||
float angle = DesiredTarget.Angle();
|
float angle = DesiredTarget.Angle();
|
||||||
float deltaTheta = Mathf.Abs(_targetTracer.Rotation - angle);
|
|
||||||
_targetTracer.Rotation = angle;
|
if (Inventory.IsUsingItem)
|
||||||
|
{
|
||||||
|
_targetTracer.Intensity = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// must turn > pi / 4 radians per second to increase intensity
|
// must turn > pi / 4 radians per second to increase intensity
|
||||||
|
float deltaTheta = Mathf.Abs(_targetTracer.Rotation - angle);
|
||||||
_targetTracer.Intensity = Mathf.Min(_targetTracer.Intensity +
|
_targetTracer.Intensity = Mathf.Min(_targetTracer.Intensity +
|
||||||
deltaTheta, 1);
|
deltaTheta, 1);
|
||||||
_targetTracer.Intensity = Mathf.Max(_targetTracer.Intensity -
|
_targetTracer.Intensity = Mathf.Max(_targetTracer.Intensity -
|
||||||
Mathf.Pi / 4 * (float)delta, 0);
|
Mathf.Pi / 4 * (float)delta, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_targetTracer.Rotation = angle;
|
||||||
|
}
|
||||||
|
|
||||||
public override void _Input(InputEvent @event)
|
public override void _Input(InputEvent @event)
|
||||||
{
|
{
|
||||||
if (StateMachine != null)
|
if (StateMachine != null)
|
||||||
|
|
Loading…
Reference in New Issue