blob: 5214f25c9020283857ae35872ddcc58eafbd2afe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_microgame_spawn_timer_timeout() -> void:
print("WAAAHAHAHA MICROGAMES")
# Spawn a microgame window
var window_scene = preload("res://scenes/microgames/microgame_window.tscn")
var window_instance = window_scene.instantiate()
add_child(window_instance)
var microgame_scene = preload("res://scenes/microgames/window_mvp.tscn")
var microgame_instance = microgame_scene.instantiate()
window_instance.add_child(microgame_instance)
# Randomize window position
var screen_size = DisplayServer.screen_get_size()
var window_x = randi_range(0, screen_size.x - window_instance.size.x)
var window_y = randi_range(0, screen_size.y - window_instance.size.y)
window_instance.position = Vector2(window_x, window_y)
|