diff options
Diffstat (limited to 'scenes/microgames/ad')
-rw-r--r-- | scenes/microgames/ad/ad_window.gd | 8 | ||||
-rw-r--r-- | scenes/microgames/ad/ad_window.tscn | 6 |
2 files changed, 12 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"] |