Plant spawn

This commit is contained in:
Rendo 2025-08-03 18:34:54 +05:00
commit 941912d7f1
25 changed files with 281 additions and 40 deletions

View file

@ -1,34 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://boxt0hfowqe66"]
[ext_resource type="Script" uid="uid://crlumefuo1biu" path="res://scripts/gui/plant_pick/seedpacket_generator.gd" id="1_celhi"]
[ext_resource type="Script" uid="uid://co3yto3q7mnm7" path="res://scripts/level/level_data.gd" id="2_pdbkq"]
[ext_resource type="Script" uid="uid://cbrhnb4tp4pem" path="res://scripts/gui/hotbar.gd" id="3_qyndx"]
[node name="PlantsPickTest" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="GridContainer" type="GridContainer" parent="."]
layout_mode = 0
anchor_left = 0.27
anchor_top = 0.48
anchor_right = 0.74
anchor_bottom = 0.94
columns = 3
script = ExtResource("1_celhi")
metadata/_edit_use_anchors_ = true
[node name="LevelData" type="Node" parent="."]
script = ExtResource("2_pdbkq")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 69.0
offset_top = 12.0
offset_right = 479.0
offset_bottom = 75.0
script = ExtResource("3_qyndx")

View file

@ -137,5 +137,6 @@ grow_vertical = 2
texture = SubResource("AtlasTexture_gtmhg")
[node name="RechargeTimer" type="Timer" parent="."]
one_shot = true
[connection signal="pressed" from="TextureButton" to="." method="on_pressed"]

View file

@ -0,0 +1,71 @@
[gd_scene load_steps=9 format=3 uid="uid://bh1yiiv1fi0b8"]
[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="1_3bchh"]
[ext_resource type="Script" uid="uid://cj8mt02far5np" path="res://scripts/level/field_rect_offsetter.gd" id="1_4dbyi"]
[ext_resource type="Script" uid="uid://cyttjwv888cb4" path="res://scripts/level/layered_entity_container.gd" id="1_ia5ss"]
[ext_resource type="Script" uid="uid://co3yto3q7mnm7" path="res://scripts/level/level_data.gd" id="1_ssqyj"]
[ext_resource type="Script" uid="uid://sjnxv5q4yk2" path="res://scripts/level/seedpacket_placer.gd" id="4_5r585"]
[ext_resource type="Script" uid="uid://crlumefuo1biu" path="res://scripts/gui/plant_pick/seedpacket_generator.gd" id="6_2y6d3"]
[ext_resource type="Script" uid="uid://cbrhnb4tp4pem" path="res://scripts/gui/plant_pick/hotbar.gd" id="7_e4b3h"]
[ext_resource type="Script" uid="uid://60lwfjb634kd" path="res://scripts/gui/plant_pick/go_button.gd" id="8_e4b3h"]
[node name="StandardLevel" type="Node"]
[node name="Data" type="Node" parent="."]
script = ExtResource("1_ssqyj")
metadata/_custom_type_script = "uid://co3yto3q7mnm7"
[node name="LayeredEntityContainer" type="Node" parent="."]
script = ExtResource("1_ia5ss")
[node name="Game" type="Node2D" parent="."]
[node name="Field Start" type="Marker2D" parent="Game"]
position = Vector2(305, 76)
script = ExtResource("1_4dbyi")
metadata/_edit_lock_ = true
[node name="SeedpacketPlacer" type="CanvasGroup" parent="Game" node_paths=PackedStringArray("entity_container")]
script = ExtResource("4_5r585")
entity_container = NodePath("../../LayeredEntityContainer")
[node name="Plants" type="Node2D" parent="Game"]
unique_name_in_owner = true
[node name="Background" type="CanvasLayer" parent="Game"]
layer = -10
follow_viewport_enabled = true
[node name="BackgroundSummer" type="Sprite2D" parent="Game/Background"]
texture = ExtResource("1_3bchh")
centered = false
metadata/_edit_lock_ = true
[node name="Camera2D" type="Camera2D" parent="Game"]
position = Vector2(517, 206)
[node name="User Interface" type="CanvasLayer" parent="."]
layer = 5
metadata/_edit_lock_ = true
[node name="GridContainer" type="GridContainer" parent="User Interface"]
offset_left = -1.0
offset_top = 216.0
offset_right = 257.0
offset_bottom = 401.0
columns = 5
script = ExtResource("6_2y6d3")
[node name="Hotbar" type="HBoxContainer" parent="User Interface"]
offset_left = -1.0
offset_top = -2.0
offset_right = 365.0
offset_bottom = 65.0
script = ExtResource("7_e4b3h")
[node name="Button" type="Button" parent="User Interface"]
offset_top = 178.0
offset_right = 124.0
offset_bottom = 210.0
text = "next state"
script = ExtResource("8_e4b3h")

15
scenes/plants/aloe.tscn Normal file
View file

@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://dba4s3ke32u0l"]
[ext_resource type="Texture2D" uid="uid://d4btl7vqi4v0q" path="res://assets/sprites/plants/aloe.tres" id="1_38l32"]
[ext_resource type="Script" uid="uid://bwdvaov8sse4k" path="res://scripts/entities/entity.gd" id="1_yhqjp"]
[node name="Aloe" type="Node2D" groups=["Plants"]]
[node name="Entity" type="Node" parent="."]
script = ExtResource("1_yhqjp")
max_hp = 30.0
layer = &"base"
metadata/_custom_type_script = "uid://bwdvaov8sse4k"
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_38l32")