🐛 Bug fixes
This commit is contained in:
		| @@ -60,13 +60,9 @@ public partial class Player : CharacterBody2D | ||||
|          | ||||
|         // If same direction as last time, accelerate | ||||
|         if (direction == _lastZoomDirection && (currentTime - _lastZoomTime) < 300) | ||||
|         { | ||||
|             _currentZoomSpeed = Mathf.Min(_currentZoomSpeed + ZoomAcceleration, MaxZoomSpeed); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             _currentZoomSpeed = BaseZoomSpeed; | ||||
|         } | ||||
|          | ||||
|         _lastZoomDirection = direction; | ||||
|         _lastZoomTime = currentTime; | ||||
|   | ||||
| @@ -75,8 +75,8 @@ public partial class TurretTile : BaseTile | ||||
|             _hasTarget = true; | ||||
|              | ||||
|             // Calculate target angle | ||||
|             var direction = (nearestEnemy.GlobalPosition - _spriteBarrel.GlobalPosition).Normalized(); | ||||
|             var targetAngle = Mathf.Atan2(direction.Y, direction.X); | ||||
|             var direction = (nearestEnemy.GlobalPosition - _barrelTip.GlobalPosition).Normalized(); | ||||
|             var targetAngle = direction.Angle() + 90f; | ||||
|  | ||||
|             // Smoothly rotate towards target | ||||
|             _spriteBarrel.Rotation = Mathf.LerpAngle(_spriteBarrel.Rotation, targetAngle, (float)delta * RotationSpeed); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user