Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
20
scripts/proximity.gd
Normal file
20
scripts/proximity.gd
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
extends Node2D
|
||||
|
||||
@export var range : int = 50
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if has_node("%Player"):
|
||||
if %Player.global_position.distance_to(global_position) < range:
|
||||
show_ins()
|
||||
else:
|
||||
hide_ins()
|
||||
|
||||
func show_ins():
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate:a", 1, 0.2)
|
||||
tween.parallel().tween_property(self, "position:y", -23, 0.2)
|
||||
|
||||
func hide_ins():
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate:a", 0, 0.2)
|
||||
tween.parallel().tween_property(self, "position:y", -16, 0.2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue