summaryrefslogtreecommitdiff
path: root/scenes/microgames/ad/ad_window.gd
diff options
context:
space:
mode:
authorZoey Kitt <zoey.kitt@outlook.com>2024-11-16 12:07:31 -0600
committerZoey Kitt <zoey.kitt@outlook.com>2024-11-16 12:07:31 -0600
commitdd480f4e6513ba39c5e37b196d323a232f95fe66 (patch)
tree267bbdb7a878a378fdc89f3b10dd8f18749f7898 /scenes/microgames/ad/ad_window.gd
parent4e03ecf7804083e21eb963c50d660221890028f6 (diff)
Ads baby lessgo sell that ad space
Diffstat (limited to 'scenes/microgames/ad/ad_window.gd')
-rw-r--r--scenes/microgames/ad/ad_window.gd7
1 files changed, 6 insertions, 1 deletions
diff --git a/scenes/microgames/ad/ad_window.gd b/scenes/microgames/ad/ad_window.gd
index 639ecd4..e397532 100644
--- a/scenes/microgames/ad/ad_window.gd
+++ b/scenes/microgames/ad/ad_window.gd
@@ -6,9 +6,14 @@ 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
+ sprite.centered = false
+ sprite.reparent(self)
+
# Stretch the funny image to fit in the window
var window_size = get_viewport().size
- var sprite := $Sprite2D
## Scale!?
sprite.scale = Vector2(
float(window_size.x) / float(sprite.texture.get_width()),