🐛 Bug fixes

This commit is contained in:
2025-08-30 23:26:19 +08:00
parent 7438ba407a
commit 88647b1c41
4 changed files with 7 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ texture = ExtResource("3_gfad6")
offset = Vector2(0, -54)
[node name="Marker2D" type="Marker2D" parent="Barrel"]
position = Vector2(0, 37.5)
position = Vector2(0, -225)
scale = Vector2(12.5, 12.5)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View File

@@ -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;

View File

@@ -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);

View File

@@ -17,6 +17,8 @@ config/icon="res://icon.svg"
[display]
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="viewport"
[dotnet]
@@ -83,4 +85,6 @@ toggle_build={
[rendering]
anti_aliasing/quality/msaa_2d=3
anti_aliasing/quality/msaa_3d=3
anti_aliasing/quality/screen_space_aa=1
anti_aliasing/quality/use_taa=true