Update flower entity to spawn snails based on game state.
- Added Snail entity with states for eating and sleeping. - Modified Flowers script to handle snail spawning logic.
This commit is contained in:
parent
9988ee23de
commit
908f834181
8 changed files with 143 additions and 2 deletions
24
entities/Snail.tscn
Normal file
24
entities/Snail.tscn
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bnwvtlsvxjmel"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/scripts/snail.gd" id="1_lkvd1"]
|
||||
[ext_resource type="Script" path="res://entities/scripts/finite_state_machine.gd" id="1_tejvt"]
|
||||
[ext_resource type="Script" path="res://entities/snail/states/snail_sleeping.gd" id="3_wnrnl"]
|
||||
[ext_resource type="Script" path="res://entities/snail/states/snail_eating.gd" id="4_1abwi"]
|
||||
|
||||
[node name="Snail" type="Sprite2D"]
|
||||
script = ExtResource("1_lkvd1")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
|
||||
[node name="Polygon2D" type="Polygon2D" parent="."]
|
||||
polygon = PackedVector2Array(-8, -8, 4, -11, 10, 5, -7, 9, -25, 8, -22, 0, -11, 0)
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
|
||||
script = ExtResource("1_tejvt")
|
||||
initial_state = NodePath("Sleeping")
|
||||
|
||||
[node name="Sleeping" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("3_wnrnl")
|
||||
|
||||
[node name="Eating" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("4_1abwi")
|
||||
Loading…
Add table
Add a link
Reference in a new issue