From 88647b1c41fcf331032cc9105b0b1569e33ad772 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 30 Aug 2025 23:26:19 +0800 Subject: [PATCH] :bug: Bug fixes --- Scenes/Tiles/TurretTile.tscn | 2 +- Scripts/Entities/Player.cs | 4 ---- Scripts/Tiles/TurretTile.cs | 4 ++-- project.godot | 4 ++++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Scenes/Tiles/TurretTile.tscn b/Scenes/Tiles/TurretTile.tscn index 772997f..79ba29e 100644 --- a/Scenes/Tiles/TurretTile.tscn +++ b/Scenes/Tiles/TurretTile.tscn @@ -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="."] diff --git a/Scripts/Entities/Player.cs b/Scripts/Entities/Player.cs index 03bf51c..92c3f78 100644 --- a/Scripts/Entities/Player.cs +++ b/Scripts/Entities/Player.cs @@ -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; diff --git a/Scripts/Tiles/TurretTile.cs b/Scripts/Tiles/TurretTile.cs index 350db40..dbf1ecd 100644 --- a/Scripts/Tiles/TurretTile.cs +++ b/Scripts/Tiles/TurretTile.cs @@ -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); diff --git a/project.godot b/project.godot index fbcd135..9addbf7 100644 --- a/project.godot +++ b/project.godot @@ -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