initial commit
This commit is contained in:
commit
e446938ba7
74 changed files with 3212 additions and 0 deletions
15
Spawner.gd
Normal file
15
Spawner.gd
Normal file
|
@ -0,0 +1,15 @@
|
|||
extends Marker2D
|
||||
|
||||
@export var item: PackedScene
|
||||
@export var random_on_screen = false
|
||||
|
||||
func spawn():
|
||||
for i in range(10):
|
||||
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
|
||||
if not $"../CollisionCheck".is_clear(test_pos):
|
||||
continue
|
||||
var node = item.instantiate()
|
||||
node.global_position = test_pos
|
||||
print(node.global_position)
|
||||
$/root/Node2D.add_child(node)
|
||||
break
|
Loading…
Add table
Add a link
Reference in a new issue