45 lines
1.4 KiB
GDScript
45 lines
1.4 KiB
GDScript
extends Sprite2D
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
pass
|
|
var sizer = 648
|
|
|
|
func _on_area_2d_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
|
|
if body.name == "plr":
|
|
body.can_move = false
|
|
self.visible = false
|
|
$Area2D.queue_free()
|
|
var dial = body.get_node("Camera2D/dialogue")
|
|
var tweener2 = get_tree().create_tween()
|
|
tweener2.tween_property(get_parent().get_node("the_hole"),"volume_db",-100,2)
|
|
dial.visible = true
|
|
dial.dialogue("Wow...","upsidedown",0.5)
|
|
await get_parent().proceed
|
|
dial.dialogue("5 {CURRENCY}.","nervous",0.5)
|
|
await get_parent().proceed
|
|
dial.dialogue("That was worth it!","normal",0.5)
|
|
await get_parent().proceed
|
|
dial.dialogue("How am I supposed to get back up...","nervous",2)
|
|
await get_parent().proceed
|
|
dial.dialogue("Cliffhanger!","normal",1)
|
|
await get_parent().proceed
|
|
dial.visible = false
|
|
var fader = body.get_node("CanvasLayer/fadeout")
|
|
fader.size.y = 0
|
|
fader.visible = true
|
|
var tweener = get_tree().create_tween()
|
|
tweener.set_ease(Tween.EASE_OUT)
|
|
tweener.set_trans(Tween.TRANS_BOUNCE)
|
|
tweener.tween_property(fader,"size",Vector2(1152,sizer),3)
|
|
|
|
await tweener.finished
|
|
await get_tree().create_timer(1).timeout
|
|
get_tree().change_scene_to_file("res://end.tscn")
|