summaryrefslogtreecommitdiff
path: root/scenes/main.gd
diff options
context:
space:
mode:
authorZoey Kitt <zoey.kitt@outlook.com>2024-11-17 14:06:00 -0600
committerZoey Kitt <zoey.kitt@outlook.com>2024-11-17 14:06:00 -0600
commit0f1b81588b2590e51fc6253f030eea68189a7b74 (patch)
tree1d19dadb8fc43efc738ab7686713ca69ca2d6a5d /scenes/main.gd
parent88172d8807b560fb4fec794c3b32015d9e48a159 (diff)
Make the fishing minigame communicate the fish caught on win
Diffstat (limited to 'scenes/main.gd')
-rw-r--r--scenes/main.gd28
1 files changed, 21 insertions, 7 deletions
diff --git a/scenes/main.gd b/scenes/main.gd
index 4600689..e48cff7 100644
--- a/scenes/main.gd
+++ b/scenes/main.gd
@@ -1,5 +1,8 @@
extends Node2D
+var fishes = [Fishin.FishType.GAR, Fishin.FishType.SALMON, Fishin.FishType.BASS, Fishin.FishType.HUMUHUMUNUKUNUKUAPUA_A, Fishin.FishType.CATFSIH, Fishin.FishType.DOGFISH, Fishin.FishType.ANGLERFISH, Fishin.FishType.MOBY_DICK, Fishin.FishType.LEAPING_SMACKEREL]
+
+
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
@@ -13,13 +16,19 @@ func _process(delta: float) -> void:
func _on_microgame_spawn_timer_timeout() -> void:
- print("WAAAHAHAHA MICROGAMES")
-
# Spawn a microgame window
- var window_scene = preload("res://scenes/microgames/ad/ad_window.tscn")
- var window_instance = window_scene.instantiate()
-
- print(type_string(typeof(window_instance)))
+ var window_instance = null
+ if (randf() < 20.5):
+ var window_scene = preload("res://scenes/microgames/microgame_window.tscn")
+ window_instance = window_scene.instantiate()
+ var fishin_scene = preload("res://scenes/microgames/fishin/node_2d.tscn")
+ var fishin_instance = fishin_scene.instantiate()
+ fishin_instance.win.connect(on_other_fishin_win)
+
+ window_instance.add_child(fishin_instance)
+ else:
+ var window_scene = preload("res://scenes/microgames/ad/ad_window.tscn")
+ window_instance = window_scene.instantiate()
add_child(window_instance)
@@ -37,7 +46,7 @@ func _on_microgame_win(window: MicrogameWindow):
print("yay")
-func _on_fishin_win() -> void:
+func _on_fishin_win(fish_caught: Fishin.FishType) -> void:
$Fishin.queue_free()
$"Stock ticker".start()
$"Microgame spawn timer".start()
@@ -63,3 +72,8 @@ func _on_score_window_donezo() -> void:
var gameover_scene_instance = gameover_scene.instantiate()
new_window.add_child(gameover_scene_instance)
add_child(new_window)
+
+
+# This is the one for the fishing microgame that appears after the first one
+func on_other_fishin_win(fish_caught: Fishin.FishType):
+ print(fish_caught)