Lesson Completed
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ca4ilsycpp4su"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ca4ilsycpp4su"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cag5s4yohpx7r" path="res://Loops/Scripts/Loops.gd" id="1_18ujs"]
|
||||
[ext_resource type="PackedScene" uid="uid://dkqrjahyouim0" path="res://Loops/Scenes/Star.tscn" id="2_jwddc"]
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
script = ExtResource("1_18ujs")
|
||||
|
||||
[node name="Star" parent="." instance=ExtResource("2_jwddc")]
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
zoom = Vector2(2, 2)
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
extends Node2D
|
||||
#NEXT This is where we are editing right now
|
||||
|
||||
@export var spawn_count : int = 200
|
||||
var star_scene = preload("res://Loops/Scenes/Star.tscn")
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
for i in spawn_count:
|
||||
var star = star_scene.instantiate()
|
||||
add_child(star)
|
||||
|
||||
star.position.x = randi_range(-280, 280)
|
||||
star.position.y = randi_range(-150, 150)
|
||||
|
||||
var star_size = randf_range(0.5, 1.0)
|
||||
star.scale.x = star_size
|
||||
star.scale.y = star_size
|
||||
|
||||
Reference in New Issue
Block a user