Tidy UP!
This commit is contained in:
parent
7ce2863cfd
commit
e216364ec1
12 changed files with 84 additions and 71 deletions
|
|
@ -9,6 +9,7 @@ static var _last_chase: AudioStream = null
|
|||
|
||||
var speed: int = 3
|
||||
var clumsiness: int = 0
|
||||
var _saved: bool = false
|
||||
|
||||
@onready var safety_zone = get_node("/root/Game/World/ElevatorSafeZone")
|
||||
|
||||
|
|
@ -28,12 +29,14 @@ func _ready():
|
|||
CONNECT_ONE_SHOT
|
||||
)
|
||||
|
||||
func _physics_process(delta):
|
||||
velocity.z -= speed * delta
|
||||
func _physics_process(_delta):
|
||||
velocity.z = -speed
|
||||
move_and_slide()
|
||||
|
||||
func _on_area_3d_area_entered(area: Area3D) -> void:
|
||||
var safety = safety_zone
|
||||
if area == safety:
|
||||
print("Safe!")
|
||||
queue_free()
|
||||
if area == safety_zone and not _saved:
|
||||
_saved = true
|
||||
get_tree().create_timer(0.5).timeout.connect(
|
||||
func(): queue_free(),
|
||||
CONNECT_ONE_SHOT
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue