feat: 添加手枪武器
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user