feat: 添加手枪武器

This commit is contained in:
luke358
2026-05-19 21:07:44 +08:00
parent 4fa565e0e9
commit dc26a7cf60
27 changed files with 348 additions and 2 deletions
+9
View File
@@ -26,6 +26,8 @@ func _process(delta: float) -> void:
rotate_to_target()
update_visuals()
if can_use_weapon():
use_weapon()
@@ -73,6 +75,13 @@ func get_idle_rotation() -> float:
else:
return PI
func update_visuals() -> void:
if abs(rotation) > PI / 2:
sprite_2d.scale.y = -0.5
else :
sprite_2d.scale.y = 0.5
func calculate_spread() -> void:
weapon_spread += randf_range(-1 + data.stats.accurary, 1- data.stats.accurary)