-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get Godot head when Tiki is saved; Tiki is happy to see the player ag…
…ain (#221) * Updated exports * Removed 'dialogic' settings * Fixed bug on 'finished' dialog event; Added dialog after Tiki is saved * Show godot head when tiki is freed * Added GameState event when tiki is freed * New game resets events * Godot head can only be collected if visible * Added text when player approaches tiki * Tiki is happy to see the player again
- Loading branch information
1 parent
4c68984
commit 8b4ac85
Showing
11 changed files
with
163 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,45 @@ | ||
extends Node3D | ||
|
||
signal tiki_freed | ||
|
||
func _ready() -> void: | ||
if GameState.events.tiki_freed: | ||
$CageStaticBody3D.queue_free() | ||
$AnimationPlayer.stop() | ||
$tiki_npc/Label3D.hide() | ||
|
||
func free_tiki() -> void: | ||
$AnimationPlayer.stop() | ||
var tween = create_tween() | ||
# Move Tiki to the floor. | ||
tween.tween_property($tiki_npc, "position:y",0, 0.25) | ||
$tiki_npc/Label3D.hide() | ||
await get_tree().create_timer(1).timeout | ||
|
||
# Move Tiki to the floor. | ||
create_tween().tween_property($tiki_npc, "position:y", 0, 0.25) | ||
|
||
GameState.dialog.set_text( | ||
"Thanks for saving me, maaan!\n" + | ||
"I found this blue thingy in the beach... you can have it." | ||
) | ||
GameState.dialog.open_dialog() | ||
|
||
await GameState.dialog.finished | ||
|
||
$tiki_npc/Label3D.text = "THANKS!" | ||
$tiki_npc/Label3D.show() | ||
var tween_2 = create_tween().set_loops() | ||
tween_2.tween_property($tiki_npc, "position:y", 0.5, 0.25) | ||
tween_2.tween_property($tiki_npc, "position:y", 0, 0.25) | ||
|
||
GameState.events.tiki_freed = true | ||
emit_signal("tiki_freed") | ||
|
||
func _on_area_3d_body_entered(body): | ||
if GameState.events.tiki_freed: | ||
$tiki_npc/Label3D.text = "Hey, maaan!" | ||
$tiki_npc/Label3D.show() | ||
var tween = create_tween().set_loops(2) | ||
tween.tween_property($tiki_npc, "position:y", 0.5, 0.25) | ||
tween.tween_property($tiki_npc, "position:y", 0, 0.25) | ||
|
||
func _on_area_3d_body_exited(body): | ||
if GameState.events.tiki_freed: | ||
$tiki_npc/Label3D.hide() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.