summaryrefslogtreecommitdiff
path: root/scenes/microgames
diff options
context:
space:
mode:
Diffstat (limited to 'scenes/microgames')
-rw-r--r--scenes/microgames/ad/ad_window.gd8
-rw-r--r--scenes/microgames/ad/ad_window.tscn6
-rw-r--r--scenes/microgames/fishin/fishin.gd2
-rw-r--r--scenes/microgames/microgame_window.gd2
4 files changed, 16 insertions, 2 deletions
diff --git a/scenes/microgames/ad/ad_window.gd b/scenes/microgames/ad/ad_window.gd
index 3e3fc33..88111a9 100644
--- a/scenes/microgames/ad/ad_window.gd
+++ b/scenes/microgames/ad/ad_window.gd
@@ -6,6 +6,7 @@ extends "res://scenes/microgames/microgame_window.gd"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
+
# Choose a random ad
var all_ads := $"All ads"
var sprite := all_ads.get_children().pick_random() as Sprite2D
@@ -20,7 +21,6 @@ func _ready() -> void:
float(window_size.y) / float(sprite.texture.get_height())
)
-
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
@@ -34,3 +34,9 @@ func _on_close_requested() -> void:
func _on_texture_button_pressed() -> void:
OS.shell_open("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
+ lose.emit(self)
+
+
+
+func _on_timer_timeout() -> void:
+ ad_open.emit(self)
diff --git a/scenes/microgames/ad/ad_window.tscn b/scenes/microgames/ad/ad_window.tscn
index 7c98b6e..1d4d78d 100644
--- a/scenes/microgames/ad/ad_window.tscn
+++ b/scenes/microgames/ad/ad_window.tscn
@@ -26,7 +26,7 @@
[ext_resource type="Texture2D" uid="uid://diqk5cl2rehkg" path="res://scenes/microgames/ad/ad_images/wizard_sexy.png" id="24_ipkoa"]
[ext_resource type="Texture2D" uid="uid://x1m2v51rug76" path="res://scenes/microgames/ad/ad_images/wtf.png" id="25_o5yc3"]
-[node name="Window" instance=ExtResource("1_gtv65")]
+[node name="Window2" instance=ExtResource("1_gtv65")]
title = "Check out this special offer [Click Here]"
size = Vector2i(824, 604)
content_scale_size = Vector2i(0, 0)
@@ -110,4 +110,8 @@ texture = ExtResource("25_o5yc3")
offset_right = 1000.0
offset_bottom = 1000.0
+[node name="Timer" type="Timer" parent="." index="2"]
+autostart = true
+
[connection signal="pressed" from="TextureButton" to="." method="_on_texture_button_pressed"]
+[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
diff --git a/scenes/microgames/fishin/fishin.gd b/scenes/microgames/fishin/fishin.gd
index c3d6c78..d52e449 100644
--- a/scenes/microgames/fishin/fishin.gd
+++ b/scenes/microgames/fishin/fishin.gd
@@ -14,6 +14,7 @@ enum FishType {
}
signal win(fish_type: FishType)
+signal lose
signal fish_chosen(fish_sprite: Sprite2D, fish_name: String)
const IN_GAME_WAIT_TIME = 10
@@ -200,6 +201,7 @@ func _on_in_game_timeout() -> void:
$"Fart".play()
get_window().title = "🙂👎"
+ lose.emit()
func _on_success_fail_timeout() -> void:
diff --git a/scenes/microgames/microgame_window.gd b/scenes/microgames/microgame_window.gd
index 40d3d63..5b44f23 100644
--- a/scenes/microgames/microgame_window.gd
+++ b/scenes/microgames/microgame_window.gd
@@ -3,6 +3,8 @@ class_name MicrogameWindow
signal win(this: MicrogameWindow)
+signal lose(this: MicrogameWindow)
+signal ad_open(this: MicrogameWindow)
func _on_close_requested() -> void: