sfx update

This commit is contained in:
ultrablob 2024-04-20 09:45:17 -04:00
parent bf16dfe508
commit cd361e3338
16 changed files with 682 additions and 105 deletions

View file

@ -1,14 +1,16 @@
extends Line2D
@export var target_shield = false
func _ready():
$RayCast2D.target_position = $"..".linear_velocity * 5000
$RayCast2D.force_raycast_update()
func _physics_process(delta):
#global_rotation = $"..".linear_velocity.angle()
$RayCast2D.target_position = $"..".linear_velocity * 5000
points[1] = $"..".linear_velocity * 5000
if $RayCast2D.get_collider() != null and $RayCast2D.get_collider().name == "Player":
$RayCast2D.target_position = to_local($"..".linear_velocity * 5000)
points[1] = to_local($RayCast2D.get_collision_point())
if $RayCast2D.get_collider() != null and ["Player", "Shield" if target_shield else "None"].has($RayCast2D.get_collider().name):
visible = true
else:
visible = false