-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSYST.gd
49 lines (25 loc) · 798 Bytes
/
SYST.gd
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Dziq 2024 - 2028
# v0.1
extends Node2D
export var small_screen := false
export var game_duration := 30
onready var mob_timer_reduce_per_sec := 2.2 / game_duration
func _ready() -> void:
randomize()
# G.load_config()
window_prepare()
var LEVEL = preload("res://Level.tscn").instance()
add_child(LEVEL)
func window_prepare() -> void:
var display_size = OS.get_screen_size()
var window_size = G.window
if small_screen == true:
window_size *= Vector2(.5, .5)
else:
window_size *= Vector2(4, 4)
if display_size.y <= window_size.y:
var scale_ratio = window_size.y / (display_size.y - 80)
window_size.x /= scale_ratio ; window_size.y /= scale_ratio
OS.window_size = window_size
window_size.y += 64
OS.window_position = display_size * .5 - window_size * .5