start of tossing system

This commit is contained in:
Haze Weathers 2024-09-22 14:17:54 -04:00
parent f5999da412
commit dc2a1a78f3
12 changed files with 193 additions and 38 deletions

View file

@ -22,6 +22,7 @@ var input_dir: float = 0.0
var aim_back_arm: bool = false
var _was_on_floor: bool = true
var _highlighted_pickup: Pickup = null
func _ready() -> void:
@ -117,3 +118,17 @@ func _airborn_physics_process(delta: float) -> void:
velocity += get_gravity() * delta
#endregion
#endregion
#region Collision Signals
func _on_pickup_area_entered(area: Area2D) -> void:
if not _highlighted_pickup:
_highlighted_pickup = area.get_parent() as Pickup
_highlighted_pickup.highlight = true
func _on_pickup_area_exited(area: Area2D) -> void:
if _highlighted_pickup == (area.get_parent() as Pickup):
_highlighted_pickup.highlight = false
_highlighted_pickup = null
#endregion