Skip to content

Commit

Permalink
Get Godot head when Tiki is saved; Tiki is happy to see the player ag…
Browse files Browse the repository at this point in the history
…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
telmotrooper authored Jul 11, 2023
1 parent 4c68984 commit 8b4ac85
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 68 deletions.
10 changes: 9 additions & 1 deletion autoload/game_state.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ var godot_heads_collected = {
"BeachGodotHead": false,
"BridgeGodotHead": false,
"PalmTreeGodotHead": false,
"SandRampGodotHead": false
"SandRampGodotHead": false,
"CagedTikiGodotHead": false
},
"LakeMap": {
"GodotHead": false,
Expand Down Expand Up @@ -60,6 +61,10 @@ var cutscenes_played = {
"avocado_beach_preview": false
}

var events = {
"tiki_freed": false
}

var collision_layers = {}

const initial_grass = 3000
Expand Down Expand Up @@ -104,6 +109,9 @@ func initialize() -> void: # Used in "New Game".
for property in cutscenes_played:
cutscenes_played[property] = false

for property in events:
events[property] = false

hub_1_at_night = true
gems_collected = {}
godot_heads_collected = bytes_to_var(initial_godot_heads_collected)
Expand Down
30 changes: 13 additions & 17 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/bptc=true
texture_format/s3tc=true
Expand Down Expand Up @@ -54,23 +53,19 @@ encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/identity_type=0
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
Expand Down Expand Up @@ -120,14 +115,14 @@ encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_encryption_key=""

[preset.2.options]

export/distribution_type=1
binary_format/architecture="universal"
custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
debug/export_console_wrapper=1
application/icon=""
application/icon_interpolation=4
application/bundle_identifier="net.telmotrooper.squashthecreeps"
Expand All @@ -137,11 +132,18 @@ application/short_version="1.0"
application/version="1.0"
application/copyright=""
application/copyright_localized={}
application/min_macos_version="10.12"
display/high_res=false
xcode/platform_build="14C18"
xcode/sdk_version="13.1"
xcode/sdk_build="22C55"
xcode/sdk_name="macosx13.1"
xcode/xcode_version="1420"
xcode/xcode_build="14C18"
codesign/codesign=1
codesign/installer_identity=""
codesign/apple_team_id=""
codesign/identity=""
codesign/certificate_file=""
codesign/certificate_password=""
codesign/entitlements/custom_file=""
codesign/entitlements/allow_jit_code_execution=false
codesign/entitlements/allow_unsigned_executable_memory=false
Expand All @@ -167,12 +169,6 @@ codesign/entitlements/app_sandbox/files_movies=0
codesign/entitlements/app_sandbox/helper_executables=[]
codesign/custom_options=PackedStringArray()
notarization/notarization=0
notarization/apple_id_name=""
notarization/apple_id_password=""
notarization/apple_team_id=""
notarization/api_uuid=""
notarization/api_key=""
notarization/api_key_id=""
privacy/microphone_usage_description=""
privacy/microphone_usage_description_localized={}
privacy/camera_usage_description=""
Expand Down
3 changes: 3 additions & 0 deletions maps/avocado_beach.gd
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ func set_minimap_visible(value: bool) -> void:

func hide_map_name() -> void:
GameState.UserInterface.get_node("MapName").hide()

func _on_tiki_freed():
$CagedTikiNPC/CagedTikiGodotHeadAnimationPlayer.play("appear")
85 changes: 84 additions & 1 deletion maps/avocado_beach.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=88 format=3 uid="uid://bji1tdapoh0ct"]
[gd_scene load_steps=91 format=3 uid="uid://bji1tdapoh0ct"]

[ext_resource type="Script" path="res://maps/avocado_beach.gd" id="1_1tay5"]
[ext_resource type="AudioStream" uid="uid://c1y5qugat84ue" path="res://assets/house_in_a_forest_loop.ogg" id="2_livli"]
Expand Down Expand Up @@ -525,6 +525,79 @@ _data = {
"preview": SubResource("Animation_i3fst")
}

[sub_resource type="Animation" id="Animation_ku3vj"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CagedTikiGodotHead:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CagedTikiGodotHead:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_umxow"]
resource_name = "appear"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CagedTikiGodotHead:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 1.5708, 0), Vector3(0, 7.85398, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CagedTikiGodotHead:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CagedTikiGodotHead:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_p5igw"]
_data = {
"RESET": SubResource("Animation_ku3vj"),
"appear": SubResource("Animation_umxow")
}

[node name="AvocadoBeach" type="Node3D"]
script = ExtResource("1_1tay5")
map_music = ExtResource("2_livli")
Expand Down Expand Up @@ -1346,10 +1419,20 @@ transform = Transform3D(1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926,
[node name="CagedTikiNPC" parent="." instance=ExtResource("44_wr07v")]
transform = Transform3D(0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, 0.866025, 13.7607, 0.0819117, -256.247)

[node name="CagedTikiGodotHead" parent="CagedTikiNPC" instance=ExtResource("17_tburi")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -5.2, 3, 3)
visible = false

[node name="CagedTikiGodotHeadAnimationPlayer" type="AnimationPlayer" parent="CagedTikiNPC"]
libraries = {
"": SubResource("AnimationLibrary_p5igw")
}

[connection signal="pressed" from="Map/GreenPlatform2/Ramp/RedButton" to="." method="_on_RedButton_pressed"]
[connection signal="animation_finished" from="Map/MovingPlatforms/Manual/AnimationPlayer" to="Map/MovingPlatforms/Manual" method="_on_AnimationPlayer_animation_finished"]
[connection signal="timeout" from="Map/MovingPlatforms/Manual/MovingPlatformTimer" to="Map/MovingPlatforms/Manual" method="_on_FloatingPlatformTimer_timeout"]
[connection signal="body_entered" from="Map/BlueCube/SprintTutorial" to="." method="_on_SprintTutorial_body_entered"]
[connection signal="tiki_freed" from="CagedTikiNPC" to="." method="_on_tiki_freed"]

[editable path="SandPlatform/Isle/isle"]
[editable path="SandPlatform/IslePath/isle_path"]
38 changes: 34 additions & 4 deletions maps/extras/caged_tiki_npc/caged_tiki_npc.gd
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()
21 changes: 17 additions & 4 deletions maps/extras/caged_tiki_npc/caged_tiki_npc.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://by4x3rbps47k6"]
[gd_scene load_steps=11 format=3 uid="uid://by4x3rbps47k6"]

[ext_resource type="PackedScene" uid="uid://nkarq1qbnp1v" path="res://props/cage/cage.blend" id="1_uac30"]
[ext_resource type="Script" path="res://maps/extras/caged_tiki_npc/caged_tiki_npc.gd" id="1_uxdyq"]
Expand Down Expand Up @@ -71,6 +71,9 @@ _data = {
[sub_resource type="BoxShape3D" id="BoxShape3D_q38xr"]
size = Vector3(6, 5.2, 6)

[sub_resource type="SphereShape3D" id="SphereShape3D_nvae3"]
radius = 10.0

[node name="CagedTikiNPC" type="Node3D"]
script = ExtResource("1_uxdyq")

Expand All @@ -88,17 +91,27 @@ transform = Transform3D(-1, 0, 2.53518e-06, 0, 1, 0, -2.53518e-06, 0, -1, 0, 0,
[node name="Label3D" type="Label3D" parent="tiki_npc"]
transform = Transform3D(-1, 0, -2.53518e-06, 0, 1, 0, 2.53518e-06, 0, -1, 0, 5.8, 0)
pixel_size = 0.025
billboard = 2
text = "HELP!"
font = ExtResource("3_63fx1")

[node name="StaticBody3D" type="StaticBody3D" parent="." groups=["spinnable"]]
[node name="CageStaticBody3D" type="StaticBody3D" parent="." groups=["spinnable"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.183237, 0, 0.383657)
collision_layer = 64
script = ExtResource("3_376bk")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="CageStaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.192559, 2.5, -0.4)
shape = SubResource("BoxShape3D_q38xr")

[node name="cage" parent="StaticBody3D" instance=ExtResource("1_uac30")]
[node name="cage" parent="CageStaticBody3D" instance=ExtResource("1_uac30")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.183237, 0, -0.383657)

[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16

[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("SphereShape3D_nvae3")

[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]
[connection signal="body_exited" from="Area3D" to="." method="_on_area_3d_body_exited"]
2 changes: 0 additions & 2 deletions maps/hub_1.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ func _on_AudioStreamPlayer_finished() -> void:
func _on_CutsceneAnimationPlayer_animation_finished(_anim_name: String) -> void:
GameState.dialog.set_text("The ship is completely busted... I won't be able to get out of here easily. Where IS here though?")
GameState.dialog.open_dialog()
await GameState.dialog.finished
GameState.UserInterface.get_node("%Minimap").show()
2 changes: 1 addition & 1 deletion maps/hub_1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ transform = Transform3D(0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0, 0, 1, 8.
script = ExtResource("18")

[node name="Smoke" parent="Spaceship" instance=ExtResource("5")]
transform = Transform3D(-0.268486, 0.87273, 0.407749, -0.097721, 0.396431, -0.912849, -0.958314, -0.284933, -0.0211522, -2.43791, 2.20846, -1.00656)
transform = Transform3D(-0.268486, 0.87273, 0.407749, -0.0977209, 0.396431, -0.912849, -0.958314, -0.284933, -0.0211522, -2.43791, 2.20846, -1.00656)
skeleton = NodePath("")

[node name="SpaceshipArea" type="Area3D" parent="Spaceship"]
Expand Down
37 changes: 0 additions & 37 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,6 @@ GameState="*res://autoload/game_state.tscn"
Hotkeys="*res://autoload/hotkeys.gd"
Utils="*res://autoload/utils.gd"

[dialogic]

editor/character_preview_mode=0
editor/current_editor=&"Timeline Editor"
editor/current_resources={
"Character Editor": "res://dialogic/characters/player.dch",
"Timeline Editor": "res://dialogic/timelines/intro.dtl"
}
animations/join_default_length=0.5
animations/leave_default_length=0.5
animations/leave_default_wait=true
animations/join_default_wait=true
choices/autofocus_first=true
choices/delay=0.2
text/speed=0.038
text/skippable=true
text/autocontinue_delay=1.0
history/history_system=false
history/full_history=true
history/text_history=true
save/autosave_delay=60.0
variables={}
glossary/default_case_sensitive=true
layout/mode=0
editor/current_timeline_path="res://dialogic/timelines/broken_spaceship.dtl"
editor/timeline_editor_mode=0
editor/last/resources=["res://dialogic/timelines/broken_spaceship.dtl", "res://dialogic/timelines/intro.dtl"]
editor/visual_timeline_editor_sidebar=200.0
layout/export_overrides={
"box_modulate": "Color(0.00784314, 0.00784314, 0.00784314, 0.705882)",
"name_label_box_modulate": "Color(0.00784314, 0.00784314, 0.00784314, 0.705882)",
"name_label_font_size": "24.0",
"text_size": "24.0"
}
layout_scene="res://addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.tscn"
editor/custom_testing_layout="res://addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.tscn"

[display]

window/size/viewport_width=1280
Expand Down
Loading

0 comments on commit 8b4ac85

Please sign in to comment.