diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-11-17 14:46:56 -0600 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-11-17 14:46:56 -0600 |
commit | 8ccae5aad9d896d3ec4a4684c30ae35f14794569 (patch) | |
tree | 233ada59af6c24dd0eb484f7b5c180d85d9ea506 /scenes/microgames/ad | |
parent | c4acb25795de1996a9eed88a8b1c4134c22cc4d0 (diff) |
add losing money
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 | 4 |
2 files changed, 11 insertions, 1 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..dd89a93 100644 --- a/scenes/microgames/ad/ad_window.tscn +++ b/scenes/microgames/ad/ad_window.tscn @@ -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"] |