Done refactoring

This commit is contained in:
2ndbeam 2023-11-05 21:51:47 +03:00
commit 2176e9d798
88 changed files with 821 additions and 880 deletions

View file

@ -0,0 +1,14 @@
extends Node2D
@export var star : PackedScene
@export var stars_amount = 1000
func _ready():
var map_width_halved = get_tree().current_scene.map_width / 2
var map_height_halved = get_tree().current_scene.map_height / 2
for i in range(stars_amount):
var star_inst = star.instantiate()
var x = randi_range(-map_width_halved, map_width_halved)
var y = randi_range(-map_height_halved, map_height_halved)
add_child(star_inst)
star_inst.position = Vector2(x, y)