Initial commit (1/2)
This commit is contained in:
commit
3411c5796d
66 changed files with 2261 additions and 0 deletions
12
scripts/StarsGeneration.gd
Normal file
12
scripts/StarsGeneration.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extends Node2D
|
||||
|
||||
@export var Star : PackedScene
|
||||
@export var StarsAmount = 1000
|
||||
|
||||
func _ready():
|
||||
var MapWidthH = get_tree().current_scene.MapWidth / 2
|
||||
var MapHeightH = get_tree().current_scene.MapHeight / 2
|
||||
for i in range(StarsAmount):
|
||||
var StarInstance = Star.instantiate()
|
||||
add_child(StarInstance)
|
||||
StarInstance.position = Vector2(randi_range(-MapWidthH, MapWidthH), randi_range(-MapHeightH, MapHeightH))
|
||||
Loading…
Add table
Add a link
Reference in a new issue