summaryrefslogtreecommitdiff
path: root/Stage
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-09-28 15:29:16 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-09-28 15:29:16 +0200
commit62e90b444315245ef24606fa51d3fccba5f18e08 (patch)
tree3a8a7390cf319d6a4ddd70bf32ca83fbe20bec31 /Stage
initial commitHEADmain
Diffstat (limited to 'Stage')
-rw-r--r--Stage/balloons.gd12
-rw-r--r--Stage/balloons.tscn32
2 files changed, 44 insertions, 0 deletions
diff --git a/Stage/balloons.gd b/Stage/balloons.gd
new file mode 100644
index 0000000..a242bc0
--- /dev/null
+++ b/Stage/balloons.gd
@@ -0,0 +1,12 @@
+extends Node2D
+
+
+func _on_spawn_timer_timeout() -> void:
+ var balloon = preload("res://Target/balloon.tscn").instantiate()
+ balloon.global_position = Vector2(
+ randf_range(get_viewport_rect().position.x, get_viewport_rect().end.x),
+ randf_range(get_viewport_rect().position.y, get_viewport_rect().end.y)
+ )
+ balloon.velocity = Vector2(randf_range(-1.0, 1.0) * 20, randf_range(-1.0, 1.0) * 20)
+ balloon.modulate = Color(randf(), randf(), randf())
+ add_child(balloon)
diff --git a/Stage/balloons.tscn b/Stage/balloons.tscn
new file mode 100644
index 0000000..63cd919
--- /dev/null
+++ b/Stage/balloons.tscn
@@ -0,0 +1,32 @@
+[gd_scene load_steps=5 format=3 uid="uid://ddthntf36xojy"]
+
+[ext_resource type="Script" path="res://Stage/balloons.gd" id="1_fuioi"]
+[ext_resource type="PackedScene" uid="uid://cuemoig58el4f" path="res://UI/hud.tscn" id="2_tsbp8"]
+[ext_resource type="Texture2D" uid="uid://cyw52lkxbbnbb" path="res://UI/Assets/background.jpg" id="3_sh8m8"]
+[ext_resource type="PackedScene" uid="uid://bn0h50n6fr6n1" path="res://Player/bow.tscn" id="4_0t5n3"]
+
+[node name="Balloons" type="Node2D"]
+script = ExtResource("1_fuioi")
+
+[node name="HUD" parent="." instance=ExtResource("2_tsbp8")]
+
+[node name="Background" type="CanvasLayer" parent="."]
+layer = -1
+
+[node name="TextureRect" type="TextureRect" parent="Background"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+texture = ExtResource("3_sh8m8")
+expand_mode = 1
+
+[node name="Bow" parent="." instance=ExtResource("4_0t5n3")]
+position = Vector2(104, 152)
+
+[node name="SpawnTimer" type="Timer" parent="."]
+wait_time = 0.5
+autostart = true
+
+[connection signal="timeout" from="SpawnTimer" to="." method="_on_spawn_timer_timeout"]