updating project files
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
[gd_scene load_steps=75 format=3 uid="uid://dy43c80qlfftx"]
|
||||
[gd_scene format=3 uid="uid://dy43c80qlfftx"]
|
||||
|
||||
[ext_resource type="Shader" path="res://godot_state_charts_examples/ant_hill/ant/ant.gdshader" id="1_01qat"]
|
||||
[ext_resource type="Shader" uid="uid://bx4vu24rcr0m5" path="res://godot_state_charts_examples/ant_hill/ant/ant.gdshader" id="1_01qat"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqgc7cft671q0" path="res://godot_state_charts_examples/ant_hill/ant/walk.png" id="1_7ajse"]
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/ant_hill/ant/ant.gd" id="1_i761n"]
|
||||
[ext_resource type="Script" uid="uid://d4ld8mlrjp04a" path="res://godot_state_charts_examples/ant_hill/ant/ant.gd" id="1_i761n"]
|
||||
[ext_resource type="PackedScene" uid="uid://dy5xrmjffewnk" path="res://godot_state_charts_examples/ant_hill/marker/marker.tscn" id="2_lqnr1"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="3_lard5"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="4_ejp2e"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="5_21sgy"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_qj278"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_lard5"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_ejp2e"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_21sgy"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="7_qj278"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bjtx1"]
|
||||
shader = ExtResource("1_01qat")
|
||||
@@ -466,7 +466,7 @@ height = 12.0
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_htg24"]
|
||||
radius = 80.0
|
||||
|
||||
[node name="Ant" type="CharacterBody2D"]
|
||||
[node name="Ant" type="CharacterBody2D" unique_id=357919111]
|
||||
z_index = 2048
|
||||
z_as_relative = false
|
||||
collision_layer = 16
|
||||
@@ -477,7 +477,7 @@ safe_margin = 2.615
|
||||
script = ExtResource("1_i761n")
|
||||
marker_scene = ExtResource("2_lqnr1")
|
||||
|
||||
[node name="Sprite2D" type="AnimatedSprite2D" parent="."]
|
||||
[node name="Sprite2D" type="AnimatedSprite2D" parent="." unique_id=1030931224]
|
||||
material = SubResource("ShaderMaterial_bjtx1")
|
||||
rotation = 1.5708
|
||||
scale = Vector2(0.05, 0.05)
|
||||
@@ -485,186 +485,200 @@ sprite_frames = SubResource("SpriteFrames_kcoy1")
|
||||
animation = &"walk"
|
||||
frame_progress = 0.938219
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="." unique_id=1705676987]
|
||||
editor_description = "This navigation agent sends the \"navigation_finished\" event to the state chart whenever the navigation is done."
|
||||
avoidance_enabled = true
|
||||
radius = 40.0
|
||||
max_speed = 50.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1692864822]
|
||||
position = Vector2(0, 1)
|
||||
shape = SubResource("CapsuleShape2D_1lk3q")
|
||||
|
||||
[node name="SensorArea" type="Area2D" parent="."]
|
||||
[node name="SensorArea" type="Area2D" parent="." unique_id=1997461294]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="SensorArea"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="SensorArea" unique_id=1493720022]
|
||||
shape = SubResource("CircleShape2D_htg24")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1652274412]
|
||||
script = ExtResource("3_lard5")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=1619485726]
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Initializing")
|
||||
|
||||
[node name="Initializing" type="Node" parent="StateChart/Root"]
|
||||
[node name="Initializing" type="Node" parent="StateChart/Root" unique_id=1173467514]
|
||||
editor_description = "This state is used for script initialization."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="Transition" type="Node" parent="StateChart/Root/Initializing"]
|
||||
[node name="Transition" type="Node" parent="StateChart/Root/Initializing" unique_id=1132136339]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Seeking Food")
|
||||
event = &"initialized"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Seeking Food" type="Node" parent="StateChart/Root"]
|
||||
[node name="Seeking Food" type="Node" parent="StateChart/Root" unique_id=35708485]
|
||||
editor_description = "In this state, the ant will look for food."
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Seeking Food"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Seeking Food" unique_id=2055371097]
|
||||
editor_description = "This state is active when the ant currently has no target. It is connected to the script which will look for a new target."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Next Destination" type="Node" parent="StateChart/Root/Seeking Food/Idle"]
|
||||
[node name="On Next Destination" type="Node" parent="StateChart/Root/Seeking Food/Idle" unique_id=837784741]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Travelling/Place Marker")
|
||||
event = &"destination_set"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Food Detected" type="Node" parent="StateChart/Root/Seeking Food/Idle"]
|
||||
[node name="On Food Detected" type="Node" parent="StateChart/Root/Seeking Food/Idle" unique_id=718952215]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../../Picking up Food")
|
||||
event = &"food_detected"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Seeking Food"]
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Seeking Food" unique_id=1951054255]
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Travel")
|
||||
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Seeking Food/Travelling"]
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Seeking Food/Travelling" unique_id=1442664241]
|
||||
editor_description = "When navigation is finished return to idle state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"navigation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Travel" type="Node" parent="StateChart/Root/Seeking Food/Travelling"]
|
||||
[node name="Travel" type="Node" parent="StateChart/Root/Seeking Food/Travelling" unique_id=857682499]
|
||||
editor_description = "This state is active while the ant is travelling when searching for food. Periodically the state will be left for placing a marker."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="Periodically Place Marker" type="Node" parent="StateChart/Root/Seeking Food/Travelling/Travel"]
|
||||
[node name="Periodically Place Marker" type="Node" parent="StateChart/Root/Seeking Food/Travelling/Travel" unique_id=120374019]
|
||||
editor_description = "While searching for food, periodically place a marker pointing towards the nest. This transition will move to the \"Place Marker\" state which will trigger the placement of the marker. The \"Place Marker\" state will immediately return back to the \"Travel\" state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Place Marker")
|
||||
delay_seconds = 0.75
|
||||
delay_in_seconds = "0.75"
|
||||
|
||||
[node name="Place Marker" type="Node" parent="StateChart/Root/Seeking Food/Travelling"]
|
||||
[node name="Place Marker" type="Node" parent="StateChart/Root/Seeking Food/Travelling" unique_id=1932547830]
|
||||
editor_description = "This state is briefly activated when the ant wants to place a marker. It will immediately exit again to the \"Travel\" state."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="Return travelling" type="Node" parent="StateChart/Root/Seeking Food/Travelling/Place Marker"]
|
||||
[node name="Return travelling" type="Node" parent="StateChart/Root/Seeking Food/Travelling/Place Marker" unique_id=1482996519]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Travel")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Picking up Food" type="Node" parent="StateChart/Root"]
|
||||
[node name="Picking up Food" type="Node" parent="StateChart/Root" unique_id=1498579937]
|
||||
editor_description = "This state is active when the ant has detected food and wants to pick it up."
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Travelling")
|
||||
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Picking up Food"]
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Picking up Food" unique_id=1898584525]
|
||||
editor_description = "This state is active while the ant is moving towards the food."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Picking up Food/Travelling"]
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Picking up Food/Travelling" unique_id=1459603142]
|
||||
editor_description = "When navigation is finished we can pick up the food."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Picking Up")
|
||||
event = &"navigation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Picking Up" type="Node" parent="StateChart/Root/Picking up Food"]
|
||||
[node name="Picking Up" type="Node" parent="StateChart/Root/Picking up Food" unique_id=691826560]
|
||||
editor_description = "This state is active when the ant has reached the food and now picks it up."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Picked Up" type="Node" parent="StateChart/Root/Picking up Food/Picking Up"]
|
||||
[node name="On Picked Up" type="Node" parent="StateChart/Root/Picking up Food/Picking Up" unique_id=1812353397]
|
||||
editor_description = "When navigation is finished return to idle state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../../Returning Home")
|
||||
event = &"food_picked_up"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Food Vanished" type="Node" parent="StateChart/Root/Picking up Food/Picking Up"]
|
||||
[node name="On Food Vanished" type="Node" parent="StateChart/Root/Picking up Food/Picking Up" unique_id=1828759205]
|
||||
editor_description = "When navigation is finished return to idle state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../../Seeking Food")
|
||||
event = &"food_vanished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Returning Home" type="Node" parent="StateChart/Root"]
|
||||
[node name="Returning Home" type="Node" parent="StateChart/Root" unique_id=68722348]
|
||||
editor_description = "This state is active when the ant has found food and wants to return home."
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Returning Home"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Returning Home" unique_id=1472914152]
|
||||
editor_description = "This state is active when the ant currently has no destination. It calls back into the script which will setup a new destination."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Next Destination" type="Node" parent="StateChart/Root/Returning Home/Idle"]
|
||||
[node name="On Next Destination" type="Node" parent="StateChart/Root/Returning Home/Idle" unique_id=1710164190]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Travelling")
|
||||
event = &"destination_set"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Nest Detected" type="Node" parent="StateChart/Root/Returning Home/Idle"]
|
||||
[node name="On Nest Detected" type="Node" parent="StateChart/Root/Returning Home/Idle" unique_id=1259208177]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../../Delivering Food")
|
||||
event = &"nest_detected"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Returning Home"]
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Returning Home" unique_id=1574608417]
|
||||
editor_description = "This state is active when the ant has a destination and is currently travelling."
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Travel")
|
||||
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Returning Home/Travelling"]
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Returning Home/Travelling" unique_id=843084238]
|
||||
editor_description = "When navigation is finished return to idle state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"navigation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Travel" type="Node" parent="StateChart/Root/Returning Home/Travelling"]
|
||||
[node name="Travel" type="Node" parent="StateChart/Root/Returning Home/Travelling" unique_id=391342697]
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="Periodically Place Marker" type="Node" parent="StateChart/Root/Returning Home/Travelling/Travel"]
|
||||
[node name="Periodically Place Marker" type="Node" parent="StateChart/Root/Returning Home/Travelling/Travel" unique_id=20755757]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Place Marker")
|
||||
delay_seconds = 1.0
|
||||
delay_in_seconds = "1.0"
|
||||
|
||||
[node name="Place Marker" type="Node" parent="StateChart/Root/Returning Home/Travelling"]
|
||||
[node name="Place Marker" type="Node" parent="StateChart/Root/Returning Home/Travelling" unique_id=826088477]
|
||||
editor_description = "This state is active when the ant has a destination and is moving towards it."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="Return travelling" type="Node" parent="StateChart/Root/Returning Home/Travelling/Place Marker"]
|
||||
[node name="Return travelling" type="Node" parent="StateChart/Root/Returning Home/Travelling/Place Marker" unique_id=210360225]
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Travel")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Delivering Food" type="Node" parent="StateChart/Root"]
|
||||
[node name="Delivering Food" type="Node" parent="StateChart/Root" unique_id=113331670]
|
||||
editor_description = "This state is active when the ant has detected the nest and wants to bring food back."
|
||||
script = ExtResource("4_ejp2e")
|
||||
initial_state = NodePath("Travelling")
|
||||
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Delivering Food"]
|
||||
[node name="Travelling" type="Node" parent="StateChart/Root/Delivering Food" unique_id=2113420401]
|
||||
editor_description = "This state is active when the ant is moving towards the nest."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Delivering Food/Travelling"]
|
||||
[node name="On Navigation Finish" type="Node" parent="StateChart/Root/Delivering Food/Travelling" unique_id=1612529738]
|
||||
editor_description = "When navigation is finished we can pick up the food."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../Dropping")
|
||||
event = &"navigation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dropping" type="Node" parent="StateChart/Root/Delivering Food"]
|
||||
[node name="Dropping" type="Node" parent="StateChart/Root/Delivering Food" unique_id=844996374]
|
||||
editor_description = "This state is active when the ant is dropping the food off at the nest."
|
||||
script = ExtResource("5_21sgy")
|
||||
|
||||
[node name="On Dropped" type="Node" parent="StateChart/Root/Delivering Food/Dropping"]
|
||||
[node name="On Dropped" type="Node" parent="StateChart/Root/Delivering Food/Dropping" unique_id=1491069231]
|
||||
editor_description = "When navigation is finished return to idle state."
|
||||
script = ExtResource("7_qj278")
|
||||
to = NodePath("../../../Seeking Food")
|
||||
event = &"food_dropped"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[connection signal="input_event" from="." to="." method="_on_input_event"]
|
||||
[connection signal="ready" from="Sprite2D" to="Sprite2D" method="play" binds= ["walk"]]
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/walk.png-77b94883438df4792795bd4b6c922fa6.cte
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -6,4 +6,3 @@ func _ready():
|
||||
randomize()
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/banana.svg-e48dc3ddd49722cb94ca8f088061cec6.c
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bqalfgp8jjady"]
|
||||
[gd_scene format=3 uid="uid://bqalfgp8jjady"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cqt6bgiwgqym7" path="res://godot_state_charts_examples/ant_hill/banana/banana.svg" id="1_uoy0d"]
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
radius = 7.99901
|
||||
height = 32.0275
|
||||
|
||||
[node name="banana" type="Node2D" groups=["food"]]
|
||||
[node name="banana" type="Node2D" unique_id=419400810 groups=["food"]]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1930543110]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_uoy0d")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=1672513448]
|
||||
metadata/owner = NodePath("..")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1969441031]
|
||||
rotation = 1.5865
|
||||
shape = SubResource("CapsuleShape2D_vo3bi")
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/circle_white.svg-63c895b75f0338e9c3ca264b8781
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dy5xrmjffewnk"]
|
||||
[gd_scene format=3 uid="uid://dy5xrmjffewnk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b3k7i5rrn5hhl" path="res://godot_state_charts_examples/ant_hill/marker/circle_white.svg" id="1_2vg4s"]
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/ant_hill/marker/marker.gd" id="2_2b6iy"]
|
||||
[ext_resource type="Script" uid="uid://dikixfhsqssxf" path="res://godot_state_charts_examples/ant_hill/marker/marker.gd" id="2_2b6iy"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_0xsut"]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
[node name="Node2D" type="Node2D" unique_id=953097858]
|
||||
script = ExtResource("2_2b6iy")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=1576504907]
|
||||
texture_filter = 1
|
||||
rotation = 1.5708
|
||||
texture = ExtResource("1_2vg4s")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=987914028]
|
||||
metadata/owner = NodePath("..")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1096694080]
|
||||
shape = SubResource("CircleShape2D_0xsut")
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/nest.svg-4361abbd79cc59afa101f89034d762a6.cte
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[gd_scene format=3 uid="uid://sql8ln0s26la"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://xb5fialweqfw" path="res://godot_state_charts_examples/ant_hill/nest/nest.svg" id="1_8slek"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_b8f1n"]
|
||||
radius = 37.1214
|
||||
|
||||
[node name="Nest" type="Sprite2D" groups=["nest"]]
|
||||
[node name="Nest" type="Sprite2D" unique_id=1978929971 groups=["nest"]]
|
||||
texture = ExtResource("1_8slek")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=632483343]
|
||||
metadata/owner = NodePath("..")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1316671415]
|
||||
position = Vector2(-1, -1)
|
||||
shape = SubResource("CircleShape2D_b8f1n")
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://huy14b6x10bh"]
|
||||
[gd_scene format=3 uid="uid://huy14b6x10bh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bgswg1pgd01d1" path="res://godot_state_charts_examples/platformer/ninja_frog/full.png" id="2_dka03"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="3_7ryss"]
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/automatic_transitions/the_frog.gd" id="3_q65wd"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="4_64ox6"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="5_ooc8l"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/parallel_state.gd" id="5_uojl1"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_7ryss"]
|
||||
[ext_resource type="Script" uid="uid://jjduf53mb1hc" path="res://godot_state_charts_examples/automatic_transitions/the_frog.gd" id="3_q65wd"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_64ox6"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_ooc8l"]
|
||||
[ext_resource type="Script" uid="uid://c1vp0ojjvaby1" path="res://addons/godot_state_charts/parallel_state.gd" id="5_uojl1"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="6_xggmu"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_v4wmr"]
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/automatic_transitions/stamina_bar.gd" id="9_rtmjc"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_is_active_guard.gd" id="10_caxti"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/not_guard.gd" id="11_rfa1s"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="7_v4wmr"]
|
||||
[ext_resource type="Script" uid="uid://dn780r00o0xam" path="res://godot_state_charts_examples/automatic_transitions/stamina_bar.gd" id="9_rtmjc"]
|
||||
[ext_resource type="Script" uid="uid://bambbrd2wupx0" path="res://addons/godot_state_charts/state_is_active_guard.gd" id="10_caxti"]
|
||||
[ext_resource type="Script" uid="uid://dgd4i8hrrxfvm" path="res://addons/godot_state_charts/not_guard.gd" id="11_rfa1s"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2fogg"]
|
||||
size = Vector2(275, 15)
|
||||
@@ -67,129 +67,127 @@ tracks/0/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ghdrh"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_nb642"),
|
||||
"pulsate": SubResource("Animation_wtk5r")
|
||||
&"RESET": SubResource("Animation_nb642"),
|
||||
&"pulsate": SubResource("Animation_wtk5r")
|
||||
}
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
[node name="Node2D" type="Node2D" unique_id=1567464787]
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("6_xggmu")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=601586270 instance=ExtResource("6_xggmu")]
|
||||
offset_left = 293.0
|
||||
offset_top = 10.0
|
||||
offset_right = 624.0
|
||||
offset_bottom = 441.0
|
||||
initial_node_to_watch = NodePath("../TheFrog/StateChart")
|
||||
|
||||
[node name="Borders" type="StaticBody2D" parent="."]
|
||||
[node name="Borders" type="StaticBody2D" parent="." unique_id=1992267225]
|
||||
|
||||
[node name="Top" type="CollisionShape2D" parent="Borders"]
|
||||
[node name="Top" type="CollisionShape2D" parent="Borders" unique_id=90904661]
|
||||
position = Vector2(139.25, 170)
|
||||
shape = SubResource("RectangleShape2D_2fogg")
|
||||
|
||||
[node name="Bottom" type="CollisionShape2D" parent="Borders"]
|
||||
[node name="Bottom" type="CollisionShape2D" parent="Borders" unique_id=69715327]
|
||||
position = Vector2(143.25, 385)
|
||||
shape = SubResource("RectangleShape2D_2fogg")
|
||||
|
||||
[node name="Left" type="CollisionShape2D" parent="Borders"]
|
||||
[node name="Left" type="CollisionShape2D" parent="Borders" unique_id=1956694816]
|
||||
position = Vector2(11, 280.5)
|
||||
shape = SubResource("RectangleShape2D_tsftx")
|
||||
|
||||
[node name="Right" type="CollisionShape2D" parent="Borders"]
|
||||
[node name="Right" type="CollisionShape2D" parent="Borders" unique_id=539121000]
|
||||
position = Vector2(268.25, 276)
|
||||
shape = SubResource("RectangleShape2D_tsftx")
|
||||
|
||||
[node name="TheFrog" type="CharacterBody2D" parent="."]
|
||||
[node name="TheFrog" type="CharacterBody2D" parent="." unique_id=391768475]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(65.25, 288)
|
||||
script = ExtResource("3_q65wd")
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="TheFrog"]
|
||||
[node name="Icon" type="Sprite2D" parent="TheFrog" unique_id=868021493]
|
||||
texture = ExtResource("2_dka03")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 32, 32)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TheFrog"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TheFrog" unique_id=133549938]
|
||||
shape = SubResource("CapsuleShape2D_bocu2")
|
||||
|
||||
[node name="StateChart" type="Node" parent="TheFrog"]
|
||||
[node name="StateChart" type="Node" parent="TheFrog" unique_id=554953526]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("3_7ryss")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="ParallelState" type="Node" parent="TheFrog/StateChart"]
|
||||
[node name="ParallelState" type="Node" parent="TheFrog/StateChart" unique_id=394795557]
|
||||
script = ExtResource("5_uojl1")
|
||||
|
||||
[node name="Walking Control" type="Node" parent="TheFrog/StateChart/ParallelState"]
|
||||
[node name="Walking Control" type="Node" parent="TheFrog/StateChart/ParallelState" unique_id=2007824584]
|
||||
script = ExtResource("4_64ox6")
|
||||
initial_state = NodePath("Can Walk")
|
||||
|
||||
[node name="Can Walk" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control"]
|
||||
[node name="Can Walk" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control" unique_id=1752533082]
|
||||
editor_description = "In this state the frog can move around and will lose stamina. If stamina drops to 0 the frog will automatically transition to \"Needs Rest\"."
|
||||
script = ExtResource("5_ooc8l")
|
||||
|
||||
[node name="On Exhausted To Needs Rest" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control/Can Walk"]
|
||||
[node name="On Exhausted To Needs Rest" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control/Can Walk" unique_id=2012645978]
|
||||
editor_description = "This transition will listen to the \"exhausted\" event, triggered when the frog's stamina sinks to 0. We could also use an expression property tracking the stamina but using a dedicated event is faster and more extensible."
|
||||
script = ExtResource("7_v4wmr")
|
||||
to = NodePath("../../Needs Rest")
|
||||
event = &"exhausted"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Needs Rest" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control"]
|
||||
[node name="Needs Rest" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control" unique_id=1043996323]
|
||||
editor_description = "In this state the frog cannot move for 3 seconds."
|
||||
script = ExtResource("5_ooc8l")
|
||||
|
||||
[node name="After 3 seconds To Can Walk" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control/Needs Rest"]
|
||||
[node name="After 3 seconds To Can Walk" type="Node" parent="TheFrog/StateChart/ParallelState/Walking Control/Needs Rest" unique_id=2005599196]
|
||||
editor_description = "This will automatically transition back to \"Can Walk\" after 3 seconds."
|
||||
script = ExtResource("7_v4wmr")
|
||||
to = NodePath("../../Can Walk")
|
||||
delay_in_seconds = "3"
|
||||
|
||||
[node name="Animation Control" type="Node" parent="TheFrog/StateChart/ParallelState"]
|
||||
[node name="Animation Control" type="Node" parent="TheFrog/StateChart/ParallelState" unique_id=221930873]
|
||||
editor_description = "This controls the pulsating red animation when the frog is exhausted. Note that you could also model this using state_entered and state_exited events on the \"Needs Rest\" state, which is simpler (and more performant). Its only done this way to show automatic events."
|
||||
script = ExtResource("4_64ox6")
|
||||
initial_state = NodePath("Normal")
|
||||
|
||||
[node name="Normal" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control"]
|
||||
[node name="Normal" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control" unique_id=636659351]
|
||||
script = ExtResource("5_ooc8l")
|
||||
|
||||
[node name="On Needs Rest to Pulsating Red" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control/Normal"]
|
||||
[node name="On Needs Rest to Pulsating Red" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control/Normal" unique_id=1688116698]
|
||||
editor_description = "This is another example of an automatic transition. When the \"Needs Rest\" state becomes active, this will automatically transition to the \"Pulsating Red\" state."
|
||||
script = ExtResource("7_v4wmr")
|
||||
to = NodePath("../../Pulsating Red")
|
||||
guard = SubResource("Resource_m8fyc")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Pulsating Red" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control"]
|
||||
[node name="Pulsating Red" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control" unique_id=286182284]
|
||||
script = ExtResource("5_ooc8l")
|
||||
|
||||
[node name="On Not Needs Rest to Normal" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control/Pulsating Red"]
|
||||
[node name="On Not Needs Rest to Normal" type="Node" parent="TheFrog/StateChart/ParallelState/Animation Control/Pulsating Red" unique_id=432694164]
|
||||
editor_description = "When the \"Needs Rest\" state becomes inactive, this will automatically transition to the \"Normal\" state."
|
||||
script = ExtResource("7_v4wmr")
|
||||
to = NodePath("../../Normal")
|
||||
guard = SubResource("Resource_br5hd")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="TheFrog"]
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="TheFrog" unique_id=374228446]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_ghdrh")
|
||||
}
|
||||
libraries/ = SubResource("AnimationLibrary_ghdrh")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1940481045]
|
||||
offset_left = 19.25
|
||||
offset_top = 401.0
|
||||
offset_right = 272.25
|
||||
offset_bottom = 458.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
[node name="Label" type="Label" parent="VBoxContainer" unique_id=660045210]
|
||||
layout_mode = 2
|
||||
text = "Stamina"
|
||||
|
||||
[node name="StaminaBar" type="ProgressBar" parent="VBoxContainer"]
|
||||
[node name="StaminaBar" type="ProgressBar" parent="VBoxContainer" unique_id=1918943340]
|
||||
layout_mode = 2
|
||||
script = ExtResource("9_rtmjc")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
[node name="Label" type="Label" parent="." unique_id=2058097452]
|
||||
offset_right = 286.0
|
||||
offset_bottom = 156.0
|
||||
text = "This example shows automatic transitions. Move the frog with the arrow keys. If the frog loses all stamina, it automatically transitions to a state where it will be unable to move for 3 seconds."
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://cnqh7qot0estd"]
|
||||
[gd_scene format=3 uid="uid://cnqh7qot0estd"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="1_oec6f"]
|
||||
[ext_resource type="PackedScene" uid="uid://ch1pukkyc07qo" path="res://godot_state_charts_examples/cooldown/skill_button/skill_button.tscn" id="2_aahy2"]
|
||||
[ext_resource type="Texture2D" uid="uid://bphe0g2d306fe" path="res://godot_state_charts_examples/cooldown/icons/enchant-red-3.png" id="3_a8h0q"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjmc4abduaxww" path="res://godot_state_charts_examples/cooldown/icons/fireball-eerie-2.png" id="4_jhd8u"]
|
||||
[ext_resource type="Texture2D" uid="uid://b87nmomi1l48x" path="res://godot_state_charts_examples/cooldown/icons/heal-jade-2.png" id="5_xxunm"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="6_d3pqh"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/parallel_state.gd" id="7_l6ahs"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="8_pvst5"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="9_h41ei"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="10_5fig4"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="6_d3pqh"]
|
||||
[ext_resource type="Script" uid="uid://c1vp0ojjvaby1" path="res://addons/godot_state_charts/parallel_state.gd" id="7_l6ahs"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="8_pvst5"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="9_h41ei"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="10_5fig4"]
|
||||
|
||||
[node name="Cooldown Example" type="Node2D"]
|
||||
[node name="Cooldown Example" type="Node2D" unique_id=2122567517]
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("1_oec6f")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=1664704555 instance=ExtResource("1_oec6f")]
|
||||
offset_left = 290.0
|
||||
offset_top = 16.0
|
||||
offset_right = 629.0
|
||||
offset_bottom = 466.0
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="InfoLabel" type="Label" parent="."]
|
||||
[node name="InfoLabel" type="Label" parent="." unique_id=118581593]
|
||||
offset_left = 10.0
|
||||
offset_top = 24.0
|
||||
offset_right = 277.0
|
||||
@@ -28,106 +28,109 @@ offset_bottom = 128.0
|
||||
text = "This example shows how to connect delayed transitions with game UI to model skill buttons that have cooldowns. Click the buttons to try it."
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=2055911793]
|
||||
offset_left = 18.0
|
||||
offset_top = 164.0
|
||||
offset_right = 278.0
|
||||
offset_bottom = 435.0
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="AttackSkillButton" parent="VBoxContainer" instance=ExtResource("2_aahy2")]
|
||||
[node name="AttackSkillButton" parent="VBoxContainer" unique_id=2001105087 instance=ExtResource("2_aahy2")]
|
||||
editor_description = "This is the attack skill button. When you press it, it will send the \"attack\" event to the state chart."
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
texture = ExtResource("3_a8h0q")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=2119134243]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="MagicSkillButton" parent="VBoxContainer/HBoxContainer" instance=ExtResource("2_aahy2")]
|
||||
[node name="MagicSkillButton" parent="VBoxContainer/HBoxContainer" unique_id=334516547 instance=ExtResource("2_aahy2")]
|
||||
editor_description = "This is the magic skill button. When you press it, it will send the \"magic\" event to the state chart."
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_jhd8u")
|
||||
|
||||
[node name="HealSkillButton" parent="VBoxContainer/HBoxContainer" instance=ExtResource("2_aahy2")]
|
||||
[node name="HealSkillButton" parent="VBoxContainer/HBoxContainer" unique_id=1434522268 instance=ExtResource("2_aahy2")]
|
||||
editor_description = "This is the heal skill button. When you press it, it will send the \"heal\" event to the state chart."
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_xxunm")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1393050534]
|
||||
script = ExtResource("6_d3pqh")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=813086625]
|
||||
editor_description = "Since all three skills can be used independently of each other we use a parallel state as the root here."
|
||||
script = ExtResource("7_l6ahs")
|
||||
|
||||
[node name="AttackSkill" type="Node" parent="StateChart/Root"]
|
||||
[node name="AttackSkill" type="Node" parent="StateChart/Root" unique_id=995735444]
|
||||
script = ExtResource("8_pvst5")
|
||||
initial_state = NodePath("Available")
|
||||
|
||||
[node name="Available" type="Node" parent="StateChart/Root/AttackSkill"]
|
||||
[node name="Available" type="Node" parent="StateChart/Root/AttackSkill" unique_id=621169652]
|
||||
editor_description = "State indicating that attack is available. Entering this state will reset the cooldown on the attack skill button."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="On Attack To Cooldown" type="Node" parent="StateChart/Root/AttackSkill/Available"]
|
||||
[node name="On Attack To Cooldown" type="Node" parent="StateChart/Root/AttackSkill/Available" unique_id=2038100611]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Cooldown")
|
||||
event = &"attack"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/AttackSkill"]
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/AttackSkill" unique_id=1091186431]
|
||||
editor_description = "Cooldown state for the attack skill. While the delayed transition is pending, this state will send status updates on the pending transition to the attack skill button. The attack skill button will then update itself and show the remaining cooldown."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/AttackSkill/Cooldown"]
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/AttackSkill/Cooldown" unique_id=668227510]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Available")
|
||||
delay_seconds = 1.0
|
||||
delay_in_seconds = "1.0"
|
||||
|
||||
[node name="MagicSkill" type="Node" parent="StateChart/Root"]
|
||||
[node name="MagicSkill" type="Node" parent="StateChart/Root" unique_id=1434969870]
|
||||
script = ExtResource("8_pvst5")
|
||||
initial_state = NodePath("Available")
|
||||
|
||||
[node name="Available" type="Node" parent="StateChart/Root/MagicSkill"]
|
||||
[node name="Available" type="Node" parent="StateChart/Root/MagicSkill" unique_id=562565153]
|
||||
editor_description = "State indicating that the magic skill is available. Entering this state will reset the cooldown on the magic skill button."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="On Magic To Cooldown" type="Node" parent="StateChart/Root/MagicSkill/Available"]
|
||||
[node name="On Magic To Cooldown" type="Node" parent="StateChart/Root/MagicSkill/Available" unique_id=1792277839]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Cooldown")
|
||||
event = &"magic"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/MagicSkill"]
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/MagicSkill" unique_id=313937582]
|
||||
editor_description = "Cooldown state for the magic skill. While the delayed transition is pending, this state will send status updates on the pending transition to the magic skill button. The magic skill button will then update itself and show the remaining cooldown."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/MagicSkill/Cooldown"]
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/MagicSkill/Cooldown" unique_id=1842504050]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Available")
|
||||
delay_seconds = 3.0
|
||||
delay_in_seconds = "3.0"
|
||||
|
||||
[node name="HealSkill" type="Node" parent="StateChart/Root"]
|
||||
[node name="HealSkill" type="Node" parent="StateChart/Root" unique_id=1203253186]
|
||||
script = ExtResource("8_pvst5")
|
||||
initial_state = NodePath("Available")
|
||||
|
||||
[node name="Available" type="Node" parent="StateChart/Root/HealSkill"]
|
||||
[node name="Available" type="Node" parent="StateChart/Root/HealSkill" unique_id=935630631]
|
||||
editor_description = "State indicating that the heal skill is available. Entering this state will reset the cooldown on the heal skill button."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="On Heal To Cooldown" type="Node" parent="StateChart/Root/HealSkill/Available"]
|
||||
[node name="On Heal To Cooldown" type="Node" parent="StateChart/Root/HealSkill/Available" unique_id=1433492155]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Cooldown")
|
||||
event = &"heal"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/HealSkill"]
|
||||
[node name="Cooldown" type="Node" parent="StateChart/Root/HealSkill" unique_id=1602266344]
|
||||
editor_description = "Cooldown state for the heal skill. While the delayed transition is pending, this state will send status updates on the pending transition to the heal skill button. The heal skill button will then update itself and show the remaining cooldown."
|
||||
script = ExtResource("9_h41ei")
|
||||
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/HealSkill/Cooldown"]
|
||||
[node name="Back to Available" type="Node" parent="StateChart/Root/HealSkill/Cooldown" unique_id=67709776]
|
||||
script = ExtResource("10_5fig4")
|
||||
to = NodePath("../../Available")
|
||||
delay_seconds = 10.0
|
||||
delay_in_seconds = "10.0"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/AttackSkillButton" to="StateChart" method="send_event" binds= ["attack"]]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/MagicSkillButton" to="StateChart" method="send_event" binds= ["magic"]]
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/cooldown_overlay.png-5594f471c10cac21fce498b6
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/enchant-red-3.png-1df2c19bbfe03c22227b3db03bc
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/fireball-eerie-2.png-a420ae5d8f4f4f86ea5ef03e
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/heal-jade-2.png-5317fa8cf716c70c254fee8762a0d
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ch1pukkyc07qo"]
|
||||
[gd_scene format=3 uid="uid://ch1pukkyc07qo"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/cooldown/skill_button/skill_button.gd" id="1_r0ivs"]
|
||||
[ext_resource type="Script" uid="uid://cjlrmcmit4jhm" path="res://godot_state_charts_examples/cooldown/skill_button/skill_button.gd" id="1_r0ivs"]
|
||||
[ext_resource type="Texture2D" uid="uid://tgsnqiq40n41" path="res://godot_state_charts_examples/cooldown/icons/cooldown_overlay.png" id="3_pgrfi"]
|
||||
|
||||
[node name="SkillButton" type="MarginContainer"]
|
||||
[node name="SkillButton" type="MarginContainer" unique_id=384343079]
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
script = ExtResource("1_r0ivs")
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
[node name="Button" type="Button" parent="." unique_id=834783109]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextureProgressBar" type="TextureProgressBar" parent="."]
|
||||
[node name="TextureProgressBar" type="TextureProgressBar" parent="." unique_id=857403012]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
@@ -21,7 +21,7 @@ fill_mode = 4
|
||||
texture_progress = ExtResource("3_pgrfi")
|
||||
tint_progress = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
[node name="Label" type="Label" parent="." unique_id=423936835]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dlxg641x8w8tn"]
|
||||
[gd_scene format=3 uid="uid://dlxg641x8w8tn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cpw6fi5fyccic" path="res://godot_state_charts_examples/csharp/CSharpExample.cs" id="1_fkf0f"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_b878w"]
|
||||
@@ -12,10 +12,10 @@
|
||||
script = ExtResource("6_ecpvf")
|
||||
expression = "poison_count <= 0"
|
||||
|
||||
[node name="csharp_example" type="Node2D"]
|
||||
[node name="csharp_example" type="Node2D" unique_id=409791195]
|
||||
script = ExtResource("1_fkf0f")
|
||||
|
||||
[node name="InfoLabel" type="Label" parent="."]
|
||||
[node name="InfoLabel" type="Label" parent="." unique_id=2003807326]
|
||||
offset_left = 19.0
|
||||
offset_top = 33.0
|
||||
offset_right = 293.0
|
||||
@@ -24,62 +24,62 @@ text = "This is a demo on how to use Godot State Charts with C#.
|
||||
We have a turn-based game here. You can click \"Drink Poison\" to ingest 3 poison. \"Drink Cure\" will clear all poison. Wait will just wait a round. At the end of each round poison is subtracted from health or health regenerates if no poison is in the system. Print Debug prints out whether we are currently poisoned."
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="FeelLabel" type="Label" parent="."]
|
||||
[node name="FeelLabel" type="Label" parent="." unique_id=1878634681]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 23.0
|
||||
offset_top = 367.0
|
||||
offset_right = 63.0
|
||||
offset_bottom = 390.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=881290035]
|
||||
offset_left = 90.0
|
||||
offset_top = 407.0
|
||||
offset_right = 540.0
|
||||
offset_bottom = 447.0
|
||||
|
||||
[node name="DrinkPoisonButton" type="Button" parent="HBoxContainer"]
|
||||
[node name="DrinkPoisonButton" type="Button" parent="HBoxContainer" unique_id=852220665]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Drink Poison"
|
||||
|
||||
[node name="DrinkCureButton" type="Button" parent="HBoxContainer"]
|
||||
[node name="DrinkCureButton" type="Button" parent="HBoxContainer" unique_id=1647805715]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Drink Cure"
|
||||
|
||||
[node name="WaitButton" type="Button" parent="HBoxContainer"]
|
||||
[node name="WaitButton" type="Button" parent="HBoxContainer" unique_id=1802231501]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Wait"
|
||||
|
||||
[node name="PrintDebugButton" type="Button" parent="HBoxContainer"]
|
||||
[node name="PrintDebugButton" type="Button" parent="HBoxContainer" unique_id=1546010390]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Print Debug"
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=944205397]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_b878w")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=913870189]
|
||||
script = ExtResource("3_ck7cw")
|
||||
initial_state = NodePath("Normal")
|
||||
|
||||
[node name="Normal" type="Node" parent="StateChart/Root"]
|
||||
[node name="Normal" type="Node" parent="StateChart/Root" unique_id=102410483]
|
||||
script = ExtResource("4_ovkn7")
|
||||
|
||||
[node name="To Poisoned" type="Node" parent="StateChart/Root/Normal"]
|
||||
[node name="To Poisoned" type="Node" parent="StateChart/Root/Normal" unique_id=703793178]
|
||||
script = ExtResource("5_um7g8")
|
||||
to = NodePath("../../Poisoned")
|
||||
event = &"poisoned"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Poisoned" type="Node" parent="StateChart/Root"]
|
||||
[node name="Poisoned" type="Node" parent="StateChart/Root" unique_id=775790669]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("4_ovkn7")
|
||||
|
||||
[node name="To Normal On Wear Off" type="Node" parent="StateChart/Root/Poisoned"]
|
||||
[node name="To Normal On Wear Off" type="Node" parent="StateChart/Root/Poisoned" unique_id=1564960593]
|
||||
editor_description = "This transition checks at the beginning of the round i the poison count is 0 and if so transitions back to normal state."
|
||||
script = ExtResource("5_um7g8")
|
||||
to = NodePath("../../Normal")
|
||||
@@ -87,14 +87,14 @@ event = &"next_round"
|
||||
guard = SubResource("Resource_j6fet")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="To Normal On Cure" type="Node" parent="StateChart/Root/Poisoned"]
|
||||
[node name="To Normal On Cure" type="Node" parent="StateChart/Root/Poisoned" unique_id=604808615]
|
||||
editor_description = "This transition immediately goes back to normal state when the cure is taken."
|
||||
script = ExtResource("5_um7g8")
|
||||
to = NodePath("../../Normal")
|
||||
event = &"cured"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("7_yrwaw")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=559569062 instance=ExtResource("7_yrwaw")]
|
||||
offset_left = 309.0
|
||||
offset_top = 4.0
|
||||
offset_right = 636.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://b18rv6o4duide"]
|
||||
[gd_scene format=3 uid="uid://b18rv6o4duide"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bgw8xgbwc2flx" path="res://godot_state_charts_examples/history_states/white_rectangle.svg" id="1_3v23e"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_fgw1q"]
|
||||
@@ -13,10 +13,10 @@
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kl3ga"]
|
||||
size = Vector2(34.243, 33.536)
|
||||
|
||||
[node name="Node" type="Node"]
|
||||
[node name="Node" type="Node" unique_id=862962838]
|
||||
script = ExtResource("2_vphtk")
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("2_fgw1q")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=805175203 instance=ExtResource("2_fgw1q")]
|
||||
offset_left = 280.0
|
||||
offset_top = 9.0
|
||||
offset_right = -12.0
|
||||
@@ -24,64 +24,64 @@ offset_bottom = -190.0
|
||||
theme = ExtResource("8_najew")
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="Node2D" type="Sprite2D" parent="."]
|
||||
[node name="Node2D" type="Sprite2D" parent="." unique_id=974890824]
|
||||
position = Vector2(145, 206)
|
||||
scale = Vector2(6.6875, 3.90625)
|
||||
texture = ExtResource("1_3v23e")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="Node2D"]
|
||||
[node name="Area2D" type="Area2D" parent="Node2D" unique_id=1643259898]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Node2D/Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Node2D/Area2D" unique_id=1663362984]
|
||||
position = Vector2(0.0747795, 3.8147e-06)
|
||||
shape = SubResource("RectangleShape2D_kl3ga")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1329389698]
|
||||
script = ExtResource("2_pqmip")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=2011728267]
|
||||
script = ExtResource("3_nsw2j")
|
||||
initial_state = NodePath("Red Or Blue")
|
||||
|
||||
[node name="Red Or Blue" type="Node" parent="StateChart/Root"]
|
||||
[node name="Red Or Blue" type="Node" parent="StateChart/Root" unique_id=1885920353]
|
||||
script = ExtResource("3_nsw2j")
|
||||
initial_state = NodePath("Red")
|
||||
|
||||
[node name="Resume" type="Node" parent="StateChart/Root/Red Or Blue"]
|
||||
[node name="Resume" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=1200215160]
|
||||
script = ExtResource("4_0qaqv")
|
||||
default_state = NodePath("../Red")
|
||||
|
||||
[node name="Red" type="Node" parent="StateChart/Root/Red Or Blue"]
|
||||
[node name="Red" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=551636337]
|
||||
script = ExtResource("5_lh5sp")
|
||||
|
||||
[node name="To Blue" type="Node" parent="StateChart/Root/Red Or Blue/Red"]
|
||||
[node name="To Blue" type="Node" parent="StateChart/Root/Red Or Blue/Red" unique_id=2106677099]
|
||||
script = ExtResource("6_xvm5g")
|
||||
to = NodePath("../../Blue")
|
||||
delay_in_seconds = "3"
|
||||
|
||||
[node name="Blue" type="Node" parent="StateChart/Root/Red Or Blue"]
|
||||
[node name="Blue" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=1974095970]
|
||||
script = ExtResource("5_lh5sp")
|
||||
|
||||
[node name="To Red" type="Node" parent="StateChart/Root/Red Or Blue/Blue"]
|
||||
[node name="To Red" type="Node" parent="StateChart/Root/Red Or Blue/Blue" unique_id=1727482107]
|
||||
script = ExtResource("6_xvm5g")
|
||||
to = NodePath("../../Red")
|
||||
delay_in_seconds = "3"
|
||||
|
||||
[node name="On Clicked To White" type="Node" parent="StateChart/Root/Red Or Blue"]
|
||||
[node name="On Clicked To White" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=256818810]
|
||||
script = ExtResource("6_xvm5g")
|
||||
to = NodePath("../../White")
|
||||
event = &"clicked"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="White" type="Node" parent="StateChart/Root"]
|
||||
[node name="White" type="Node" parent="StateChart/Root" unique_id=2050088950]
|
||||
script = ExtResource("5_lh5sp")
|
||||
|
||||
[node name="Resume" type="Node" parent="StateChart/Root/White"]
|
||||
[node name="Resume" type="Node" parent="StateChart/Root/White" unique_id=700482805]
|
||||
script = ExtResource("6_xvm5g")
|
||||
to = NodePath("../../Red Or Blue/Resume")
|
||||
delay_in_seconds = "1"
|
||||
|
||||
[node name="Label" type="RichTextLabel" parent="."]
|
||||
[node name="Label" type="RichTextLabel" parent="." unique_id=700438554]
|
||||
offset_left = 26.0
|
||||
offset_top = 318.0
|
||||
offset_right = 376.0
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/white_rectangle.svg-4d0041e2d5db811b29367f037
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,102 +1,106 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://qr4pvbbdopme"]
|
||||
[gd_scene format=3 uid="uid://qr4pvbbdopme"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="1_67wci"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="2_oks48"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/parallel_state.gd" id="3_p72eh"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="4_v7oq1"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="5_qwp21"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="1_67wci"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="2_oks48"]
|
||||
[ext_resource type="Script" uid="uid://c1vp0ojjvaby1" path="res://addons/godot_state_charts/parallel_state.gd" id="3_p72eh"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="4_v7oq1"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="5_qwp21"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="5_xychp"]
|
||||
|
||||
[node name="order_of_events" type="Node2D"]
|
||||
[node name="order_of_events" type="Node2D" unique_id=1762595371]
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=628446543]
|
||||
editor_description = "This is just an example state chart to complement the documentation. See the section \"order of events\" in the manual for details."
|
||||
script = ExtResource("1_67wci")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="A" type="Node" parent="StateChart"]
|
||||
[node name="A" type="Node" parent="StateChart" unique_id=2102453372]
|
||||
script = ExtResource("2_oks48")
|
||||
initial_state = NodePath("B")
|
||||
|
||||
[node name="B" type="Node" parent="StateChart/A"]
|
||||
[node name="B" type="Node" parent="StateChart/A" unique_id=6730867]
|
||||
script = ExtResource("3_p72eh")
|
||||
|
||||
[node name="B1" type="Node" parent="StateChart/A/B"]
|
||||
[node name="B1" type="Node" parent="StateChart/A/B" unique_id=2015316234]
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="B2" type="Node" parent="StateChart/A/B"]
|
||||
[node name="B2" type="Node" parent="StateChart/A/B" unique_id=1183445634]
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="To C" type="Node" parent="StateChart/A/B"]
|
||||
[node name="To C" type="Node" parent="StateChart/A/B" unique_id=1169394144]
|
||||
script = ExtResource("5_qwp21")
|
||||
to = NodePath("../../C")
|
||||
event = &"c_button_pressed"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="C" type="Node" parent="StateChart/A"]
|
||||
[node name="C" type="Node" parent="StateChart/A" unique_id=92700782]
|
||||
script = ExtResource("2_oks48")
|
||||
initial_state = NodePath("C1")
|
||||
|
||||
[node name="C1" type="Node" parent="StateChart/A/C"]
|
||||
[node name="C1" type="Node" parent="StateChart/A/C" unique_id=1935347453]
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="Immediately To C2" type="Node" parent="StateChart/A/C/C1"]
|
||||
[node name="Immediately To C2" type="Node" parent="StateChart/A/C/C1" unique_id=837902384]
|
||||
editor_description = "This transition will immediately transition this state to the C2 state."
|
||||
script = ExtResource("5_qwp21")
|
||||
to = NodePath("../../C2")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="C2" type="Node" parent="StateChart/A/C"]
|
||||
[node name="C2" type="Node" parent="StateChart/A/C" unique_id=1671162619]
|
||||
editor_description = "This state has it's state_entered signal connected. The receiver of this signal will immediately trigger the \"To C3\" transition below."
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="To C3" type="Node" parent="StateChart/A/C/C2"]
|
||||
[node name="To C3" type="Node" parent="StateChart/A/C/C2" unique_id=1896835509]
|
||||
editor_description = "This transition will be called by a signal receiver connected to C2's `state_entered` signal. It will be triggered immediately when C2 is entered."
|
||||
script = ExtResource("5_qwp21")
|
||||
to = NodePath("../../C3")
|
||||
event = &"c2_entered"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="C3" type="Node" parent="StateChart/A/C"]
|
||||
[node name="C3" type="Node" parent="StateChart/A/C" unique_id=305456287]
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="To C4 after delay" type="Node" parent="StateChart/A/C/C3"]
|
||||
[node name="To C4 after delay" type="Node" parent="StateChart/A/C/C3" unique_id=2018549558]
|
||||
editor_description = "Another automatic transition, this time with a delay."
|
||||
script = ExtResource("5_qwp21")
|
||||
to = NodePath("../../C4")
|
||||
delay_seconds = 0.5
|
||||
delay_in_seconds = "0.5"
|
||||
|
||||
[node name="C4" type="Node" parent="StateChart/A/C"]
|
||||
[node name="C4" type="Node" parent="StateChart/A/C" unique_id=505656719]
|
||||
script = ExtResource("4_v7oq1")
|
||||
|
||||
[node name="To B" type="Node" parent="StateChart/A/C/C4"]
|
||||
[node name="To B" type="Node" parent="StateChart/A/C/C4" unique_id=905735584]
|
||||
script = ExtResource("5_qwp21")
|
||||
to = NodePath("../../../B")
|
||||
event = &"b_button_pressed"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("5_xychp")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=945620123 instance=ExtResource("5_xychp")]
|
||||
offset_left = 201.0
|
||||
offset_top = 11.0
|
||||
offset_right = 627.0
|
||||
offset_bottom = 450.0
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=268221687]
|
||||
offset_left = 18.0
|
||||
offset_top = 16.0
|
||||
offset_right = 174.0
|
||||
offset_bottom = 444.0
|
||||
|
||||
[node name="To C Button" type="Button" parent="VBoxContainer"]
|
||||
[node name="To C Button" type="Button" parent="VBoxContainer" unique_id=1564523307]
|
||||
layout_mode = 2
|
||||
text = "Go To C"
|
||||
|
||||
[node name="To B Button" type="Button" parent="VBoxContainer"]
|
||||
[node name="To B Button" type="Button" parent="VBoxContainer" unique_id=1959731241]
|
||||
layout_mode = 2
|
||||
text = "Go To B"
|
||||
|
||||
[node name="Spacer" type="Control" parent="VBoxContainer"]
|
||||
[node name="Spacer" type="Control" parent="VBoxContainer" unique_id=1747911988]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
[node name="Label" type="Label" parent="VBoxContainer" unique_id=519575221]
|
||||
layout_mode = 2
|
||||
text = "This demo shows the order of events when states are changing under various conditions. See the \"Order of events\" section in the manual for some explainers."
|
||||
autowrap_mode = 2
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bddhmoj1g5lv3"]
|
||||
[gd_scene format=3 uid="uid://bddhmoj1g5lv3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://berg2d0lm33m0" path="res://godot_state_charts_examples/performance_test/ten_state_charts.tscn" id="1_djj1b"]
|
||||
|
||||
[node name="hundred_state_charts" type="Node2D"]
|
||||
[node name="hundred_state_charts" type="Node2D" unique_id=653119903]
|
||||
|
||||
[node name="ten_state_charts" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts" parent="." unique_id=637267225 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts2" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts2" parent="." unique_id=1136233708 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts3" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts3" parent="." unique_id=1371545889 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts4" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts4" parent="." unique_id=837528993 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts5" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts5" parent="." unique_id=1467251260 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts6" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts6" parent="." unique_id=31186886 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts7" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts7" parent="." unique_id=1480652752 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts8" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts8" parent="." unique_id=528130720 instance=ExtResource("1_djj1b")]
|
||||
|
||||
[node name="ten_state_charts9" parent="." instance=ExtResource("1_djj1b")]
|
||||
[node name="ten_state_charts9" parent="." unique_id=253576726 instance=ExtResource("1_djj1b")]
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://b8rr57grye1kw"]
|
||||
[gd_scene format=3 uid="uid://b8rr57grye1kw"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/performance_test/state_chart_receiver.gd" id="1_44fbg"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="1_x4how"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="2_2eb2m"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="3_qtc2o"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="4_ue85n"]
|
||||
[ext_resource type="Script" uid="uid://bv6xx4hxfew5j" path="res://godot_state_charts_examples/performance_test/state_chart_receiver.gd" id="1_44fbg"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="1_x4how"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="2_2eb2m"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="3_qtc2o"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="4_ue85n"]
|
||||
|
||||
[node name="state_chart" type="Node2D"]
|
||||
[node name="state_chart" type="Node2D" unique_id=866870653]
|
||||
script = ExtResource("1_44fbg")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1339239068]
|
||||
script = ExtResource("1_x4how")
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=489713053]
|
||||
script = ExtResource("2_2eb2m")
|
||||
initial_state = NodePath("A")
|
||||
|
||||
[node name="A" type="Node" parent="StateChart/Root"]
|
||||
[node name="A" type="Node" parent="StateChart/Root" unique_id=1072926607]
|
||||
script = ExtResource("3_qtc2o")
|
||||
|
||||
[node name="To B" type="Node" parent="StateChart/Root/A"]
|
||||
[node name="To B" type="Node" parent="StateChart/Root/A" unique_id=1389728043]
|
||||
script = ExtResource("4_ue85n")
|
||||
to = NodePath("../../B")
|
||||
delay_seconds = 10.0
|
||||
delay_in_seconds = "10.0"
|
||||
|
||||
[node name="B" type="Node" parent="StateChart/Root"]
|
||||
[node name="B" type="Node" parent="StateChart/Root" unique_id=838663910]
|
||||
script = ExtResource("3_qtc2o")
|
||||
|
||||
[node name="To A" type="Node" parent="StateChart/Root/B"]
|
||||
[node name="To A" type="Node" parent="StateChart/Root/B" unique_id=515804074]
|
||||
script = ExtResource("4_ue85n")
|
||||
to = NodePath("../../A")
|
||||
delay_seconds = 20.0
|
||||
delay_in_seconds = "20.0"
|
||||
|
||||
[connection signal="state_processing" from="StateChart/Root/A" to="." method="_on_a_state_processing"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/B" to="." method="_on_b_state_physics_processing"]
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://berg2d0lm33m0"]
|
||||
[gd_scene format=3 uid="uid://berg2d0lm33m0"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b8rr57grye1kw" path="res://godot_state_charts_examples/performance_test/state_chart.tscn" id="1_sc64n"]
|
||||
|
||||
[node name="ten_state_charts" type="Node2D"]
|
||||
[node name="ten_state_charts" type="Node2D" unique_id=381182217]
|
||||
|
||||
[node name="state_chart" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart" parent="." unique_id=1859721018 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart2" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart2" parent="." unique_id=2133666606 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart3" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart3" parent="." unique_id=1792198281 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart4" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart4" parent="." unique_id=24037710 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart5" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart5" parent="." unique_id=1723944800 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart6" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart6" parent="." unique_id=1721767452 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart7" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart7" parent="." unique_id=694647167 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart8" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart8" parent="." unique_id=900444011 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart9" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart9" parent="." unique_id=664408129 instance=ExtResource("1_sc64n")]
|
||||
|
||||
[node name="state_chart10" parent="." instance=ExtResource("1_sc64n")]
|
||||
[node name="state_chart10" parent="." unique_id=2046902335 instance=ExtResource("1_sc64n")]
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://byh6mcqhp6ky2"]
|
||||
[gd_scene format=3 uid="uid://byh6mcqhp6ky2"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bddhmoj1g5lv3" path="res://godot_state_charts_examples/performance_test/hundred_state_charts.tscn" id="1_1oume"]
|
||||
|
||||
[node name="thousand_state_charts" type="Node2D"]
|
||||
[node name="thousand_state_charts" type="Node2D" unique_id=487082211]
|
||||
|
||||
[node name="hundred_state_charts" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts" parent="." unique_id=1076535442 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts2" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts2" parent="." unique_id=227458121 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts3" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts3" parent="." unique_id=207513471 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts4" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts4" parent="." unique_id=213827147 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts5" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts5" parent="." unique_id=1291011574 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts6" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts6" parent="." unique_id=1374662523 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts7" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts7" parent="." unique_id=1550349033 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts8" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts8" parent="." unique_id=526557872 instance=ExtResource("1_1oume")]
|
||||
|
||||
[node name="hundred_state_charts9" parent="." instance=ExtResource("1_1oume")]
|
||||
[node name="hundred_state_charts9" parent="." unique_id=1711975985 instance=ExtResource("1_1oume")]
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/break.png-76e3da8567a2ce2ef66cf2a31e3edc5e.ct
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -51,4 +51,3 @@ func _on_input_event(_viewport, event, _shape_idx):
|
||||
# if the left mouse button is up emit the clicked signal
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() == false:
|
||||
clicked.emit(self)
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://h0af1dot82p3"]
|
||||
[gd_scene format=3 uid="uid://h0af1dot82p3"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/platformer/breaking_box/breaking_box.gd" id="1_c2rh2"]
|
||||
[ext_resource type="Script" uid="uid://b7gcoyovuxkvo" path="res://godot_state_charts_examples/platformer/breaking_box/breaking_box.gd" id="1_c2rh2"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5dogybcf6yfo" path="res://godot_state_charts_examples/platformer/breaking_box/idle.png" id="1_dixph"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="2_atynw"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_atynw"]
|
||||
[ext_resource type="Texture2D" uid="uid://dq0ww6xvgeap3" path="res://godot_state_charts_examples/platformer/breaking_box/hit.png" id="3_ngvxc"]
|
||||
[ext_resource type="Texture2D" uid="uid://p8vbysdruo4o" path="res://godot_state_charts_examples/platformer/breaking_box/break.png" id="4_jb7vf"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="5_wouwd"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_p4jwe"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_1ecad"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/expression_guard.gd" id="8_8riiw"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="5_wouwd"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="6_p4jwe"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="7_1ecad"]
|
||||
[ext_resource type="Script" uid="uid://le5w1cm0ul8p" path="res://addons/godot_state_charts/expression_guard.gd" id="8_8riiw"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_toibu"]
|
||||
resource_name = "Break"
|
||||
@@ -303,10 +303,10 @@ tracks/6/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_t7nrw"]
|
||||
_data = {
|
||||
"Break": SubResource("Animation_toibu"),
|
||||
"Hit": SubResource("Animation_rc67x"),
|
||||
"Idle": SubResource("Animation_yu346"),
|
||||
"RESET": SubResource("Animation_a7q8m")
|
||||
&"Break": SubResource("Animation_toibu"),
|
||||
&"Hit": SubResource("Animation_rc67x"),
|
||||
&"Idle": SubResource("Animation_yu346"),
|
||||
&"RESET": SubResource("Animation_a7q8m")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8vd2b"]
|
||||
@@ -322,16 +322,16 @@ expression = "health > 0"
|
||||
script = ExtResource("8_8riiw")
|
||||
expression = "health <= 0"
|
||||
|
||||
[node name="BreakingBox" type="StaticBody2D"]
|
||||
[node name="BreakingBox" type="StaticBody2D" unique_id=534758517]
|
||||
input_pickable = true
|
||||
script = ExtResource("1_c2rh2")
|
||||
|
||||
[node name="BoxSprite" type="Sprite2D" parent="."]
|
||||
[node name="BoxSprite" type="Sprite2D" parent="." unique_id=1821804679]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -10)
|
||||
texture = ExtResource("1_dixph")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
[node name="Label" type="Label" parent="." unique_id=768290235]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
@@ -349,71 +349,69 @@ text = "3"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=2068351657]
|
||||
unique_name_in_owner = true
|
||||
editor_description = "The animation player will send an \"animation_finished\" event back to the state chart. This will then take the appropriate transitions (e.g. switch back to the idle animation)."
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_t7nrw")
|
||||
}
|
||||
libraries/ = SubResource("AnimationLibrary_t7nrw")
|
||||
|
||||
[node name="BoxCollider" type="CollisionShape2D" parent="."]
|
||||
[node name="BoxCollider" type="CollisionShape2D" parent="." unique_id=1852854685]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_8vd2b")
|
||||
|
||||
[node name="DetectionArea" type="Area2D" parent="."]
|
||||
[node name="DetectionArea" type="Area2D" parent="." unique_id=292614492]
|
||||
position = Vector2(0, -3)
|
||||
collision_layer = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea" unique_id=474512921]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -19)
|
||||
shape = SubResource("RectangleShape2D_jbwph")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1844845311]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_atynw")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=1462549900]
|
||||
script = ExtResource("5_wouwd")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Root" unique_id=110544324]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="On Damage" type="Node" parent="StateChart/Root/Idle"]
|
||||
[node name="On Damage" type="Node" parent="StateChart/Root/Idle" unique_id=1701796491]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Blinking")
|
||||
event = &"health_changed"
|
||||
guard = SubResource("Resource_v858x")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Break" type="Node" parent="StateChart/Root/Idle"]
|
||||
[node name="On Break" type="Node" parent="StateChart/Root/Idle" unique_id=72355285]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Dying")
|
||||
event = &"health_changed"
|
||||
guard = SubResource("Resource_j86i4")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Blinking" type="Node" parent="StateChart/Root"]
|
||||
[node name="Blinking" type="Node" parent="StateChart/Root" unique_id=1936694026]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Blinking"]
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Blinking" unique_id=678719973]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"animation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dying" type="Node" parent="StateChart/Root"]
|
||||
[node name="Dying" type="Node" parent="StateChart/Root" unique_id=1552619715]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Dying"]
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Dying" unique_id=818785946]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Dead")
|
||||
event = &"animation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dead" type="Node" parent="StateChart/Root"]
|
||||
[node name="Dead" type="Node" parent="StateChart/Root" unique_id=1713508340]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[connection signal="input_event" from="." to="." method="_on_input_event"]
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/hit.png-1c36fd330c418d67632dbaced016a36f.ctex
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/idle.png-ceff55276331d87b08aa0aee62d3e6af.cte
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://b22lg10c7wxrq"]
|
||||
[gd_scene format=3 uid="uid://b22lg10c7wxrq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://4nlen5j7etvq" path="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_no_flag.png" id="1_7vf2w"]
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/platformer/checkpoint/checkpoint.gd" id="1_jot5v"]
|
||||
[ext_resource type="Script" uid="uid://ccsukp7vuknqs" path="res://godot_state_charts_examples/platformer/checkpoint/checkpoint.gd" id="1_jot5v"]
|
||||
[ext_resource type="Texture2D" uid="uid://dfju87f6rw0nm" path="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_idle.png" id="2_ns71f"]
|
||||
[ext_resource type="Texture2D" uid="uid://beoe1hh5aggor" path="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_flag_out.png" id="3_fbg27"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="5_a58ma"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/parallel_state.gd" id="6_53g38"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="6_qkwqk"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="7_a74k1"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="8_7tjvh"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_is_active_guard.gd" id="10_fk2fi"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="5_a58ma"]
|
||||
[ext_resource type="Script" uid="uid://c1vp0ojjvaby1" path="res://addons/godot_state_charts/parallel_state.gd" id="6_53g38"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="6_qkwqk"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="7_a74k1"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="8_7tjvh"]
|
||||
[ext_resource type="Script" uid="uid://bambbrd2wupx0" path="res://addons/godot_state_charts/state_is_active_guard.gd" id="10_fk2fi"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xvggk"]
|
||||
length = 0.001
|
||||
@@ -210,11 +210,11 @@ tracks/2/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5pqa5"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_xvggk"),
|
||||
"close_flag": SubResource("Animation_p66ga"),
|
||||
"idle_no_flag": SubResource("Animation_w48c8"),
|
||||
"idle_with_flag": SubResource("Animation_judeo"),
|
||||
"open_flag": SubResource("Animation_gr2w7")
|
||||
&"RESET": SubResource("Animation_xvggk"),
|
||||
&"close_flag": SubResource("Animation_p66ga"),
|
||||
&"idle_no_flag": SubResource("Animation_w48c8"),
|
||||
&"idle_with_flag": SubResource("Animation_judeo"),
|
||||
&"open_flag": SubResource("Animation_gr2w7")
|
||||
}
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_06im6"]
|
||||
@@ -226,111 +226,115 @@ script = ExtResource("10_fk2fi")
|
||||
state = NodePath("../../../../Player Presence/Absent")
|
||||
metadata/_editor_prop_ptr_state = NodePath("../../../Player Presence/Absent")
|
||||
|
||||
[node name="Checkpoint" type="Node2D"]
|
||||
[node name="Checkpoint" type="Node2D" unique_id=1809495232]
|
||||
script = ExtResource("1_jot5v")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=388053107]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_7vf2w")
|
||||
offset = Vector2(0, -32)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_5pqa5")
|
||||
}
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1095415080]
|
||||
libraries/ = SubResource("AnimationLibrary_5pqa5")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=895369573]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1531705499]
|
||||
position = Vector2(-2, -26)
|
||||
shape = SubResource("CapsuleShape2D_06im6")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=820399857]
|
||||
script = ExtResource("5_a58ma")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=777667665]
|
||||
script = ExtResource("6_53g38")
|
||||
|
||||
[node name="Player Presence" type="Node" parent="StateChart/Root"]
|
||||
[node name="Player Presence" type="Node" parent="StateChart/Root" unique_id=1227806118]
|
||||
editor_description = "This compound state represents whether the player is currently present at the checkpoint."
|
||||
script = ExtResource("6_qkwqk")
|
||||
initial_state = NodePath("Absent")
|
||||
|
||||
[node name="Absent" type="Node" parent="StateChart/Root/Player Presence"]
|
||||
[node name="Absent" type="Node" parent="StateChart/Root/Player Presence" unique_id=962615558]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Player Presence/Absent"]
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Player Presence/Absent" unique_id=454764549]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Present")
|
||||
event = &"player_entered"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Present" type="Node" parent="StateChart/Root/Player Presence"]
|
||||
[node name="Present" type="Node" parent="StateChart/Root/Player Presence" unique_id=1069960291]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Exit" type="Node" parent="StateChart/Root/Player Presence/Present"]
|
||||
[node name="On Player Exit" type="Node" parent="StateChart/Root/Player Presence/Present" unique_id=1855748295]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Absent")
|
||||
event = &"player_exited"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Animation Control" type="Node" parent="StateChart/Root"]
|
||||
[node name="Animation Control" type="Node" parent="StateChart/Root" unique_id=1492305246]
|
||||
script = ExtResource("6_qkwqk")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Animation Control" unique_id=995765937]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Idle"]
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Idle" unique_id=851105802]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Expanding")
|
||||
event = &"player_entered"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Expanding" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
[node name="Expanding" type="Node" parent="StateChart/Root/Animation Control" unique_id=2141017871]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Expanding"]
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Expanding" unique_id=745397416]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Activated/Expanded")
|
||||
delay_seconds = 0.9
|
||||
delay_in_seconds = "0.9"
|
||||
|
||||
[node name="Activated" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
[node name="Activated" type="Node" parent="StateChart/Root/Animation Control" unique_id=709636235]
|
||||
script = ExtResource("6_qkwqk")
|
||||
initial_state = NodePath("Expanded")
|
||||
|
||||
[node name="Expanded" type="Node" parent="StateChart/Root/Animation Control/Activated"]
|
||||
[node name="Expanded" type="Node" parent="StateChart/Root/Animation Control/Activated" unique_id=123613028]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="Immediately" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded"]
|
||||
[node name="Immediately" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded" unique_id=1135763697]
|
||||
editor_description = "Immediately go to the retracting state when the player is no longer present when entering this state."
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Waiting To Retract")
|
||||
guard = SubResource("Resource_22wfi")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Player Leave" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded"]
|
||||
[node name="On Player Leave" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded" unique_id=101362850]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Waiting To Retract")
|
||||
event = &"player_exited"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Waiting To Retract" type="Node" parent="StateChart/Root/Animation Control/Activated"]
|
||||
[node name="Waiting To Retract" type="Node" parent="StateChart/Root/Animation Control/Activated" unique_id=1622701644]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 5 s" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract"]
|
||||
[node name="After 5 s" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract" unique_id=3878621]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../../Retracting")
|
||||
delay_seconds = 5.0
|
||||
delay_in_seconds = "5.0"
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract"]
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract" unique_id=1340440062]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Expanded")
|
||||
event = &"player_entered"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Retracting" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
[node name="Retracting" type="Node" parent="StateChart/Root/Animation Control" unique_id=338543894]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Retracting"]
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Retracting" unique_id=1157275889]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Idle")
|
||||
delay_seconds = 0.9
|
||||
delay_in_seconds = "0.9"
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||
[connection signal="body_exited" from="Area2D" to="." method="_on_area_2d_body_exited"]
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/checkpoint_flag_out.png-d1302c67d10e0b187eb8c
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/checkpoint_idle.png-450aa64af9f9812b4e2bfc351
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/checkpoint_no_flag.png-439157dcb5eca60e80049f
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/box.png-c36de003bc6b3890e50f6a4e0637c2de.ctex
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=18 format=3 uid="uid://bvrbfp870t0kd"]
|
||||
[gd_scene format=3 uid="uid://bvrbfp870t0kd"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/platformer/fireworks_box/fireworks_box.gd" id="1_6vg3k"]
|
||||
[ext_resource type="Script" uid="uid://dn46gqfbbvsnk" path="res://godot_state_charts_examples/platformer/fireworks_box/fireworks_box.gd" id="1_6vg3k"]
|
||||
[ext_resource type="Texture2D" uid="uid://roilgifkgiii" path="res://godot_state_charts_examples/platformer/fireworks_box/box.png" id="1_aido8"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="2_ahjdl"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="3_b1cau"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="4_ot1ih"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="6_bf3gq"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/expression_guard.gd" id="7_tu34q"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_ahjdl"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="3_b1cau"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="4_ot1ih"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_bf3gq"]
|
||||
[ext_resource type="Script" uid="uid://le5w1cm0ul8p" path="res://addons/godot_state_charts/expression_guard.gd" id="7_tu34q"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_y5h70"]
|
||||
script = ExtResource("7_tu34q")
|
||||
@@ -145,10 +145,10 @@ tracks/1/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_stxxq"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_0njji"),
|
||||
"explode": SubResource("Animation_81tef"),
|
||||
"idle": SubResource("Animation_yw5k5"),
|
||||
"rattle": SubResource("Animation_tug1d")
|
||||
&"RESET": SubResource("Animation_0njji"),
|
||||
&"explode": SubResource("Animation_81tef"),
|
||||
&"idle": SubResource("Animation_yw5k5"),
|
||||
&"rattle": SubResource("Animation_tug1d")
|
||||
}
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_c15xx"]
|
||||
@@ -156,84 +156,83 @@ lifetime_randomness = 0.17
|
||||
particle_flag_disable_z = true
|
||||
direction = Vector3(0, -1, 0)
|
||||
spread = 42.97
|
||||
gravity = Vector3(0, 20, 0)
|
||||
initial_velocity_min = 26.32
|
||||
initial_velocity_max = 52.63
|
||||
orbit_velocity_min = 0.0
|
||||
orbit_velocity_max = 0.0
|
||||
gravity = Vector3(0, 20, 0)
|
||||
turbulence_noise_scale = 8.14
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4ryt0"]
|
||||
|
||||
[node name="FireworksBox" type="Node2D"]
|
||||
[node name="FireworksBox" type="Node2D" unique_id=60489867]
|
||||
script = ExtResource("1_6vg3k")
|
||||
|
||||
[node name="Box" type="Sprite2D" parent="."]
|
||||
[node name="Box" type="Sprite2D" parent="." unique_id=968745388]
|
||||
position = Vector2(0, -10)
|
||||
texture = ExtResource("1_aido8")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1937350625]
|
||||
editor_description = "A state chart controlling the rattling and explosion of a box. You can probably use a simple script to achieve the same behaviour but it shows how to use expression guards."
|
||||
script = ExtResource("2_ahjdl")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=815426975]
|
||||
script = ExtResource("3_b1cau")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Root" unique_id=1866405609]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Rattle on Counter" type="Node" parent="StateChart/Root/Idle"]
|
||||
[node name="Rattle on Counter" type="Node" parent="StateChart/Root/Idle" unique_id=296489587]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Rattling")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_y5h70")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Rattling" type="Node" parent="StateChart/Root"]
|
||||
[node name="Rattling" type="Node" parent="StateChart/Root" unique_id=1998217708]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Explode on Counter" type="Node" parent="StateChart/Root/Rattling"]
|
||||
[node name="Explode on Counter" type="Node" parent="StateChart/Root/Rattling" unique_id=364618899]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Exploding")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_lsbaa")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Get back to Idle" type="Node" parent="StateChart/Root/Rattling"]
|
||||
[node name="Get back to Idle" type="Node" parent="StateChart/Root/Rattling" unique_id=1872023793]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_t7gf7")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Exploding" type="Node" parent="StateChart/Root"]
|
||||
[node name="Exploding" type="Node" parent="StateChart/Root" unique_id=323552982]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Die after 4s" type="Node" parent="StateChart/Root/Exploding"]
|
||||
[node name="Die after 4s" type="Node" parent="StateChart/Root/Exploding" unique_id=322710100]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Dead")
|
||||
delay_seconds = 4.0
|
||||
delay_in_seconds = "4.0"
|
||||
|
||||
[node name="Dead" type="Node" parent="StateChart/Root"]
|
||||
[node name="Dead" type="Node" parent="StateChart/Root" unique_id=2088449843]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=783766699]
|
||||
reset_on_save = false
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_stxxq")
|
||||
}
|
||||
libraries/ = SubResource("AnimationLibrary_stxxq")
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="." unique_id=1225582687]
|
||||
position = Vector2(0, -10)
|
||||
emitting = false
|
||||
amount = 300
|
||||
process_material = SubResource("ParticleProcessMaterial_c15xx")
|
||||
lifetime = 2.81
|
||||
one_shot = true
|
||||
explosiveness = 0.86
|
||||
process_material = SubResource("ParticleProcessMaterial_c15xx")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=606236214]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=232504032]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_4ryt0")
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/full.png-a85a82780a54dfe88e1678c76076d884.cte
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -77,4 +77,3 @@ func _on_input_event(_viewport:Node, event:InputEvent, _shape_idx:int):
|
||||
# if the left mouse button is up emit the clicked signal
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() == false:
|
||||
clicked.emit(self)
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://v5vg88it87oj"]
|
||||
[gd_scene format=3 uid="uid://v5vg88it87oj"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/platformer/ninja_frog/ninja_frog.gd" id="1_xi1lh"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="3_qw75p"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="4_g6c55"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_vmkuk"]
|
||||
[ext_resource type="Script" uid="uid://qid37o42he05" path="res://godot_state_charts_examples/platformer/ninja_frog/ninja_frog.gd" id="1_xi1lh"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_qw75p"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_g6c55"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="6_vmkuk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgswg1pgd01d1" path="res://godot_state_charts_examples/platformer/ninja_frog/full.png" id="7_fehuj"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="9_wswdv"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="9_wswdv"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1ethx"]
|
||||
radius = 12.0
|
||||
@@ -110,12 +110,12 @@ tracks/0/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_au2ov"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_uq0h4"),
|
||||
"double_jump": SubResource("Animation_10ku2"),
|
||||
"fall": SubResource("Animation_ibg22"),
|
||||
"idle": SubResource("Animation_5rh2e"),
|
||||
"jump": SubResource("Animation_jaga7"),
|
||||
"walk": SubResource("Animation_6odvc")
|
||||
&"RESET": SubResource("Animation_uq0h4"),
|
||||
&"double_jump": SubResource("Animation_10ku2"),
|
||||
&"fall": SubResource("Animation_ibg22"),
|
||||
&"idle": SubResource("Animation_5rh2e"),
|
||||
&"jump": SubResource("Animation_jaga7"),
|
||||
&"walk": SubResource("Animation_6odvc")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_k3ia7"]
|
||||
@@ -167,95 +167,89 @@ states/Start/position = Vector2(210.5, 73.75)
|
||||
transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_i3ow4"), "Idle", "Move", SubResource("AnimationNodeStateMachineTransition_a52qu"), "Move", "Idle", SubResource("AnimationNodeStateMachineTransition_1q7sj"), "Move", "DoubleJump", SubResource("AnimationNodeStateMachineTransition_4cnci"), "DoubleJump", "Move", SubResource("AnimationNodeStateMachineTransition_ddbej")]
|
||||
graph_offset = Vector2(84, -7)
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_63x7j"]
|
||||
|
||||
[node name="NinjaFrog" type="CharacterBody2D" groups=["player"]]
|
||||
[node name="NinjaFrog" type="CharacterBody2D" unique_id=529217400 groups=["player"]]
|
||||
input_pickable = true
|
||||
script = ExtResource("1_xi1lh")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=221261754]
|
||||
position = Vector2(0, -15)
|
||||
shape = SubResource("CapsuleShape2D_1ethx")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_au2ov")
|
||||
}
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=787534350]
|
||||
libraries/ = SubResource("AnimationLibrary_au2ov")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=1611622999]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("7_fehuj")
|
||||
offset = Vector2(0, -12)
|
||||
hframes = 31
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
[node name="AnimationTree" type="AnimationTree" parent="." unique_id=1352272828]
|
||||
callback_mode_process = 0
|
||||
tree_root = SubResource("AnimationNodeStateMachine_ckafx")
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
active = true
|
||||
process_callback = 0
|
||||
parameters/playback = SubResource("AnimationNodeStateMachinePlayback_63x7j")
|
||||
parameters/Move/blend_position = -0.380028
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=619602064]
|
||||
script = ExtResource("3_qw75p")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=469716716]
|
||||
editor_description = "This is the root of all movement related states."
|
||||
script = ExtResource("4_g6c55")
|
||||
initial_state = NodePath("Grounded")
|
||||
|
||||
[node name="Grounded" type="Node" parent="StateChart/Root"]
|
||||
[node name="Grounded" type="Node" parent="StateChart/Root" unique_id=492021239]
|
||||
editor_description = "This state is active when the player is on the ground."
|
||||
script = ExtResource("6_vmkuk")
|
||||
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Grounded"]
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Grounded" unique_id=876298812]
|
||||
editor_description = "When jumping become airborne and enable double-jump."
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../Airborne/DoubleJumpEnabled")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Airborne" type="Node" parent="StateChart/Root/Grounded"]
|
||||
[node name="On Airborne" type="Node" parent="StateChart/Root/Grounded" unique_id=1230549586]
|
||||
editor_description = "When becoming airborne (e.g. through falling) move to airborne state."
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../Airborne")
|
||||
event = &"airborne"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Airborne" type="Node" parent="StateChart/Root"]
|
||||
[node name="Airborne" type="Node" parent="StateChart/Root" unique_id=1758774922]
|
||||
editor_description = "This is the root state for when the player is in the air. We have sub-states to handle the various input that is allowed when in the air."
|
||||
script = ExtResource("4_g6c55")
|
||||
initial_state = NodePath("CoyoteJumpEnabled")
|
||||
|
||||
[node name="On Grounded" type="Node" parent="StateChart/Root/Airborne"]
|
||||
[node name="On Grounded" type="Node" parent="StateChart/Root/Airborne" unique_id=375743130]
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../Grounded")
|
||||
event = &"grounded"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="CoyoteJumpEnabled" type="Node" parent="StateChart/Root/Airborne"]
|
||||
[node name="CoyoteJumpEnabled" type="Node" parent="StateChart/Root/Airborne" unique_id=1605297406]
|
||||
editor_description = "While in this state, the player can jump for a short time. The state is activated by default when the player becomes airborne from falling. Allowing a jump for a short time makes the controls feel nicer. The \"On Expiration\" transition will leave this state after the grace period."
|
||||
script = ExtResource("6_vmkuk")
|
||||
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Airborne/CoyoteJumpEnabled"]
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Airborne/CoyoteJumpEnabled" unique_id=637445038]
|
||||
editor_description = "On jump handle this as if the player originally jumped."
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../DoubleJumpEnabled")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="On Expiration" type="Node" parent="StateChart/Root/Airborne/CoyoteJumpEnabled"]
|
||||
[node name="On Expiration" type="Node" parent="StateChart/Root/Airborne/CoyoteJumpEnabled" unique_id=603753836]
|
||||
editor_description = "After 0.2 seconds automatically move to falling state where no more jump is possible."
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../CannotJump")
|
||||
delay_in_seconds = "0.2"
|
||||
|
||||
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Airborne"]
|
||||
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Airborne" unique_id=1387454787]
|
||||
editor_description = "This state is active while the player is in the air and has jumped one time already. While the state is active, a second jump is allowed."
|
||||
script = ExtResource("6_vmkuk")
|
||||
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Airborne/DoubleJumpEnabled"]
|
||||
[node name="On Jump" type="Node" parent="StateChart/Root/Airborne/DoubleJumpEnabled" unique_id=376883034]
|
||||
editor_description = "When jumping in double jump state, move to a state where no more jumps are possible.
|
||||
|
||||
Triggers the double-jump animation as a side effect."
|
||||
@@ -264,7 +258,7 @@ to = NodePath("../../CannotJump")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="CannotJump" type="Node" parent="StateChart/Root/Airborne"]
|
||||
[node name="CannotJump" type="Node" parent="StateChart/Root/Airborne" unique_id=146403217]
|
||||
editor_description = "This state is active when the player is airborne but can no longer jump either because the coyote-jump grace period has expired or the player has already used the double-jump."
|
||||
script = ExtResource("6_vmkuk")
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/green.png-7e931e8924aaf6f1ff626e30e2c63319.ct
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/terrain_tiles.png-2247cd6621fc9988b0ae044edcc
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="TileSet" load_steps=6 format=3 uid="uid://cd6hbvgl1e2xy"]
|
||||
[gd_resource type="TileSet" format=3 uid="uid://cd6hbvgl1e2xy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://d2evtvw3l7jug" path="res://godot_state_charts_examples/platformer/terrain/terrain_tiles.png" id="1_g8rgd"]
|
||||
[ext_resource type="Texture2D" uid="uid://bap00a5gcipy6" path="res://godot_state_charts_examples/platformer/terrain/green.png" id="2_q18a4"]
|
||||
@@ -9,46 +9,26 @@ friction = 0.0
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_p8in1"]
|
||||
texture = ExtResource("1_g8rgd")
|
||||
6:4/0 = 0
|
||||
6:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
6:4/0/physics_layer_0/angular_velocity = 0.0
|
||||
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:4/0 = 0
|
||||
7:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
7:4/0/physics_layer_0/angular_velocity = 0.0
|
||||
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:4/0 = 0
|
||||
8:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
8:4/0/physics_layer_0/angular_velocity = 0.0
|
||||
8:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:5/0 = 0
|
||||
8:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
8:5/0/physics_layer_0/angular_velocity = 0.0
|
||||
8:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:6/0 = 0
|
||||
8:6/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
8:6/0/physics_layer_0/angular_velocity = 0.0
|
||||
8:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:6/0 = 0
|
||||
7:6/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
7:6/0/physics_layer_0/angular_velocity = 0.0
|
||||
7:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:6/0 = 0
|
||||
6:6/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
6:6/0/physics_layer_0/angular_velocity = 0.0
|
||||
6:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:5/0 = 0
|
||||
6:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
6:5/0/physics_layer_0/angular_velocity = 0.0
|
||||
6:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:5/0 = 0
|
||||
7:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
7:5/0/physics_layer_0/angular_velocity = 0.0
|
||||
7:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:0/0 = 0
|
||||
0:0/0/terrain_set = 0
|
||||
0:0/0/terrain = 0
|
||||
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 0.3125, 0.5, 0.5, 0, 8, -8, 7.5)
|
||||
0:0/0/terrains_peering_bit/right_side = 0
|
||||
0:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
@@ -56,8 +36,6 @@ texture = ExtResource("1_g8rgd")
|
||||
1:0/0 = 0
|
||||
1:0/0/terrain_set = 0
|
||||
1:0/0/terrain = 0
|
||||
1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, -8, 8, 0, -8, 0, -8, -8)
|
||||
1:0/0/terrains_peering_bit/right_side = 0
|
||||
1:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
@@ -67,8 +45,6 @@ texture = ExtResource("1_g8rgd")
|
||||
1:1/0 = 0
|
||||
1:1/0/terrain_set = 0
|
||||
1:1/0/terrain = 0
|
||||
1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:1/0/terrains_peering_bit/right_side = 0
|
||||
1:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
1:1/0/terrains_peering_bit/bottom_side = 0
|
||||
@@ -80,8 +56,6 @@ texture = ExtResource("1_g8rgd")
|
||||
2:1/0 = 0
|
||||
2:1/0/terrain_set = 0
|
||||
2:1/0/terrain = 0
|
||||
2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(0, -8, 8, -8, 8, 8, 0, 8)
|
||||
2:1/0/terrains_peering_bit/bottom_side = 0
|
||||
2:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
@@ -91,8 +65,6 @@ texture = ExtResource("1_g8rgd")
|
||||
2:2/0 = 0
|
||||
2:2/0/terrain_set = 0
|
||||
2:2/0/terrain = 0
|
||||
2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(0, -8, 8, -8, 8, 8, -8, 8, -8, 0, 0, 0)
|
||||
2:2/0/terrains_peering_bit/left_side = 0
|
||||
2:2/0/terrains_peering_bit/top_left_corner = 0
|
||||
@@ -100,8 +72,6 @@ texture = ExtResource("1_g8rgd")
|
||||
2:0/0 = 0
|
||||
2:0/0/terrain_set = 0
|
||||
2:0/0/terrain = 0
|
||||
2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, -8, 8, 8, -8, 8, -8, -8)
|
||||
2:0/0/terrains_peering_bit/bottom_side = 0
|
||||
2:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
@@ -109,8 +79,6 @@ texture = ExtResource("1_g8rgd")
|
||||
0:1/0 = 0
|
||||
0:1/0/terrain_set = 0
|
||||
0:1/0/terrain = 0
|
||||
0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 7.5)
|
||||
0:1/0/terrains_peering_bit/right_side = 0
|
||||
0:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
@@ -120,8 +88,6 @@ texture = ExtResource("1_g8rgd")
|
||||
0:2/0 = 0
|
||||
0:2/0/terrain_set = 0
|
||||
0:2/0/terrain = 0
|
||||
0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:2/0/terrains_peering_bit/right_side = 0
|
||||
0:2/0/terrains_peering_bit/top_side = 0
|
||||
@@ -129,8 +95,6 @@ texture = ExtResource("1_g8rgd")
|
||||
1:2/0 = 0
|
||||
1:2/0/terrain_set = 0
|
||||
1:2/0/terrain = 0
|
||||
1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, 0, 8, 8, -8, 8, -8, 0)
|
||||
1:2/0/terrains_peering_bit/right_side = 0
|
||||
1:2/0/terrains_peering_bit/left_side = 0
|
||||
@@ -141,53 +105,21 @@ texture = ExtResource("1_g8rgd")
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_gpldh"]
|
||||
texture = ExtResource("2_q18a4")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:1/0 = 0
|
||||
1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:2/0 = 0
|
||||
1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:2/0 = 0
|
||||
2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:2/0 = 0
|
||||
0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
3:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
3:1/0 = 0
|
||||
3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
3:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
3:2/0 = 0
|
||||
3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
3:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:3/0 = 0
|
||||
0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
3:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
|
||||
[resource]
|
||||
physics_layer_0/collision_layer = 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://i4v5fyt2ix01"]
|
||||
[gd_scene format=3 uid="uid://i4v5fyt2ix01"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://nji5r3vfeuwg" path="res://godot_state_charts_examples/random_transitions/wandering_frog/wandering_frog.tscn" id="1_r2x6m"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_n8tkm"]
|
||||
@@ -24,9 +24,9 @@ size = Vector2(36, 418)
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_e3j0h"]
|
||||
size = Vector2(405, 35)
|
||||
|
||||
[node name="Random Transitions" type="Node2D"]
|
||||
[node name="Random Transitions" type="Node2D" unique_id=52279508]
|
||||
|
||||
[node name="Ground" type="ColorRect" parent="."]
|
||||
[node name="Ground" type="ColorRect" parent="." unique_id=1712463191]
|
||||
material = SubResource("ShaderMaterial_8axp2")
|
||||
offset_left = 39.0
|
||||
offset_top = 68.0
|
||||
@@ -34,68 +34,68 @@ offset_right = 319.0
|
||||
offset_bottom = 478.0
|
||||
color = Color(0.0980392, 0.560784, 0.152941, 1)
|
||||
|
||||
[node name="ColliderLeft" type="StaticBody2D" parent="."]
|
||||
[node name="ColliderLeft" type="StaticBody2D" parent="." unique_id=228059170]
|
||||
position = Vector2(0, 40)
|
||||
collision_layer = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderLeft"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderLeft" unique_id=1963745429]
|
||||
position = Vector2(35, 199)
|
||||
shape = SubResource("RectangleShape2D_fkyfr")
|
||||
|
||||
[node name="ColliderRight" type="StaticBody2D" parent="."]
|
||||
[node name="ColliderRight" type="StaticBody2D" parent="." unique_id=1906713239]
|
||||
position = Vector2(329, 45)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderRight"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderRight" unique_id=173218133]
|
||||
position = Vector2(-9, 196)
|
||||
shape = SubResource("RectangleShape2D_fkyfr")
|
||||
|
||||
[node name="ColliderTop" type="StaticBody2D" parent="."]
|
||||
[node name="ColliderTop" type="StaticBody2D" parent="." unique_id=1640986237]
|
||||
position = Vector2(375, 45)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderTop"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderTop" unique_id=231369578]
|
||||
position = Vector2(-176, 12)
|
||||
shape = SubResource("RectangleShape2D_e3j0h")
|
||||
|
||||
[node name="ColliderBottom" type="StaticBody2D" parent="."]
|
||||
[node name="ColliderBottom" type="StaticBody2D" parent="." unique_id=1273630072]
|
||||
position = Vector2(375, 428)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderBottom"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ColliderBottom" unique_id=2073493117]
|
||||
position = Vector2(-188, -27)
|
||||
shape = SubResource("RectangleShape2D_e3j0h")
|
||||
|
||||
[node name="WanderingFrog" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog" parent="." unique_id=1965360825 instance=ExtResource("1_r2x6m")]
|
||||
modulate = Color(0.454902, 0.458824, 1, 1)
|
||||
position = Vector2(106, 158)
|
||||
|
||||
[node name="WanderingFrog2" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog2" parent="." unique_id=1639439330 instance=ExtResource("1_r2x6m")]
|
||||
position = Vector2(224, 208)
|
||||
|
||||
[node name="WanderingFrog3" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog3" parent="." unique_id=1873590311 instance=ExtResource("1_r2x6m")]
|
||||
position = Vector2(149, 275)
|
||||
|
||||
[node name="WanderingFrog4" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog4" parent="." unique_id=455681562 instance=ExtResource("1_r2x6m")]
|
||||
position = Vector2(297, 340)
|
||||
|
||||
[node name="WanderingFrog5" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog5" parent="." unique_id=1101589222 instance=ExtResource("1_r2x6m")]
|
||||
position = Vector2(79, 359)
|
||||
|
||||
[node name="WanderingFrog6" parent="." instance=ExtResource("1_r2x6m")]
|
||||
[node name="WanderingFrog6" parent="." unique_id=1055250854 instance=ExtResource("1_r2x6m")]
|
||||
position = Vector2(225, 126)
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("2_n8tkm")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=1215457625 instance=ExtResource("2_n8tkm")]
|
||||
offset_left = 344.0
|
||||
offset_top = 33.0
|
||||
offset_right = 636.0
|
||||
offset_bottom = 438.0
|
||||
initial_node_to_watch = NodePath("../WanderingFrog")
|
||||
|
||||
[node name="Label" type="RichTextLabel" parent="."]
|
||||
[node name="Label" type="RichTextLabel" parent="." unique_id=1358525059]
|
||||
offset_left = 10.0
|
||||
offset_top = 375.0
|
||||
offset_right = 334.0
|
||||
|
||||
@@ -46,4 +46,3 @@ func rescale():
|
||||
scale = Vector2(scale_factor, scale_factor)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://nji5r3vfeuwg"]
|
||||
[gd_scene format=3 uid="uid://nji5r3vfeuwg"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/random_transitions/wandering_frog/wandering_frog.gd" id="1_tfcjx"]
|
||||
[ext_resource type="Script" uid="uid://dg7apxhe32cgj" path="res://godot_state_charts_examples/random_transitions/wandering_frog/wandering_frog.gd" id="1_tfcjx"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgswg1pgd01d1" path="res://godot_state_charts_examples/platformer/ninja_frog/full.png" id="2_hm4wf"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="3_2vqqk"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="4_44md5"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="5_j65h7"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="6_s6am2"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/expression_guard.gd" id="7_f5w5i"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_2vqqk"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_44md5"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_j65h7"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_s6am2"]
|
||||
[ext_resource type="Script" uid="uid://le5w1cm0ul8p" path="res://addons/godot_state_charts/expression_guard.gd" id="7_f5w5i"]
|
||||
|
||||
[sub_resource type="Shader" id="Shader_pnpgx"]
|
||||
code = "shader_type canvas_item;
|
||||
@@ -123,84 +123,82 @@ tracks/0/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_au2ov"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_uq0h4"),
|
||||
"double_jump": SubResource("Animation_10ku2"),
|
||||
"fall": SubResource("Animation_ibg22"),
|
||||
"idle": SubResource("Animation_5rh2e"),
|
||||
"jump": SubResource("Animation_jaga7"),
|
||||
"walk": SubResource("Animation_6odvc")
|
||||
&"RESET": SubResource("Animation_uq0h4"),
|
||||
&"double_jump": SubResource("Animation_10ku2"),
|
||||
&"fall": SubResource("Animation_ibg22"),
|
||||
&"idle": SubResource("Animation_5rh2e"),
|
||||
&"jump": SubResource("Animation_jaga7"),
|
||||
&"walk": SubResource("Animation_6odvc")
|
||||
}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_27kjk"]
|
||||
script = ExtResource("7_f5w5i")
|
||||
expression = "randf() < 0.5"
|
||||
|
||||
[node name="WanderingFrog" type="CharacterBody2D"]
|
||||
[node name="WanderingFrog" type="CharacterBody2D" unique_id=375456938]
|
||||
collision_mask = 2
|
||||
input_pickable = true
|
||||
script = ExtResource("1_tfcjx")
|
||||
|
||||
[node name="Shadow" type="ColorRect" parent="."]
|
||||
[node name="Shadow" type="ColorRect" parent="." unique_id=509124905]
|
||||
material = SubResource("ShaderMaterial_fnfpn")
|
||||
offset_left = -19.0
|
||||
offset_top = -6.0
|
||||
offset_right = 21.0
|
||||
offset_bottom = 12.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2083496555]
|
||||
position = Vector2(0, -15)
|
||||
shape = SubResource("CapsuleShape2D_1ethx")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_au2ov")
|
||||
}
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1120842012]
|
||||
libraries/ = SubResource("AnimationLibrary_au2ov")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=1745488073]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("2_hm4wf")
|
||||
offset = Vector2(0, -12)
|
||||
hframes = 31
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=566629720]
|
||||
script = ExtResource("3_2vqqk")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Wander" type="Node" parent="StateChart"]
|
||||
[node name="Wander" type="Node" parent="StateChart" unique_id=1852255100]
|
||||
editor_description = "This controls the wandering."
|
||||
script = ExtResource("4_44md5")
|
||||
initial_state = NodePath("Decide Next")
|
||||
|
||||
[node name="Decide Next" type="Node" parent="StateChart/Wander"]
|
||||
[node name="Decide Next" type="Node" parent="StateChart/Wander" unique_id=348080485]
|
||||
editor_description = "In this state the frog randomly decides what to do next. The \"To Idle\" transition has a guard which will pick it with a chance of 50%. If it is not picked, then the \"To Walk\" transition is picked. "
|
||||
script = ExtResource("5_j65h7")
|
||||
|
||||
[node name="To Idle" type="Node" parent="StateChart/Wander/Decide Next"]
|
||||
[node name="To Idle" type="Node" parent="StateChart/Wander/Decide Next" unique_id=1796567924]
|
||||
script = ExtResource("6_s6am2")
|
||||
to = NodePath("../../Idle")
|
||||
guard = SubResource("Resource_27kjk")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="To Walk" type="Node" parent="StateChart/Wander/Decide Next"]
|
||||
[node name="To Walk" type="Node" parent="StateChart/Wander/Decide Next" unique_id=715103189]
|
||||
script = ExtResource("6_s6am2")
|
||||
to = NodePath("../../Walk")
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Wander"]
|
||||
[node name="Idle" type="Node" parent="StateChart/Wander" unique_id=1413916729]
|
||||
editor_description = "In this state the frog stands idly around for a random time."
|
||||
script = ExtResource("5_j65h7")
|
||||
|
||||
[node name="To Decide Next" type="Node" parent="StateChart/Wander/Idle"]
|
||||
[node name="To Decide Next" type="Node" parent="StateChart/Wander/Idle" unique_id=1219342053]
|
||||
editor_description = "This will bring the frog back into the \"Decide Next\" state after a random amount of time."
|
||||
script = ExtResource("6_s6am2")
|
||||
to = NodePath("../../Decide Next")
|
||||
delay_in_seconds = "randf_range(1.5, 3)"
|
||||
|
||||
[node name="Walk" type="Node" parent="StateChart/Wander"]
|
||||
[node name="Walk" type="Node" parent="StateChart/Wander" unique_id=1946572285]
|
||||
editor_description = "In this state the frog walks into a random direction for a random amount of time."
|
||||
script = ExtResource("5_j65h7")
|
||||
|
||||
[node name="To Decide Next" type="Node" parent="StateChart/Wander/Walk"]
|
||||
[node name="To Decide Next" type="Node" parent="StateChart/Wander/Walk" unique_id=1885621220]
|
||||
editor_description = "This will bring the frog back into the \"Decide Next\" state after a random amount of time."
|
||||
script = ExtResource("6_s6am2")
|
||||
to = NodePath("../../Idle")
|
||||
|
||||
@@ -55,5 +55,3 @@ func _on_drill_has_no_coal_state_stepped():
|
||||
func _on_next_round_button_pressed():
|
||||
# when the next round button is pressed we handle all currently active states
|
||||
_state_chart.step()
|
||||
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://iewxecs0uwss"]
|
||||
[gd_scene format=3 uid="uid://iewxecs0uwss"]
|
||||
|
||||
[ext_resource type="Script" path="res://godot_state_charts_examples/stepping/stepping.gd" id="1_8d8ax"]
|
||||
[ext_resource type="Script" uid="uid://dctc1yeiwh0wx" path="res://godot_state_charts_examples/stepping/stepping.gd" id="1_8d8ax"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="1_u4aev"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="2_7ehwm"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/parallel_state.gd" id="4_ohpt6"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="5_xbwwa"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_n6kwq"]
|
||||
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_78ppn"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_7ehwm"]
|
||||
[ext_resource type="Script" uid="uid://c1vp0ojjvaby1" path="res://addons/godot_state_charts/parallel_state.gd" id="4_ohpt6"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="5_xbwwa"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="6_n6kwq"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="7_78ppn"]
|
||||
|
||||
[node name="SteppingExample" type="Node2D"]
|
||||
[node name="SteppingExample" type="Node2D" unique_id=768576582]
|
||||
script = ExtResource("1_8d8ax")
|
||||
|
||||
[node name="StateChartDebugger" parent="." instance=ExtResource("1_u4aev")]
|
||||
[node name="StateChartDebugger" parent="." unique_id=1716622941 instance=ExtResource("1_u4aev")]
|
||||
offset_left = 353.0
|
||||
offset_top = 5.0
|
||||
offset_right = 635.0
|
||||
offset_bottom = 326.0
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="NextRoundButton" type="Button" parent="."]
|
||||
[node name="NextRoundButton" type="Button" parent="." unique_id=387423607]
|
||||
offset_left = 500.0
|
||||
offset_top = 421.0
|
||||
offset_right = 611.0
|
||||
offset_bottom = 454.0
|
||||
text = "Next Round"
|
||||
|
||||
[node name="AddCoalToDrillButton" type="Button" parent="."]
|
||||
[node name="AddCoalToDrillButton" type="Button" parent="." unique_id=756509678]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 371.0
|
||||
offset_top = 422.0
|
||||
@@ -33,62 +33,64 @@ offset_right = 482.0
|
||||
offset_bottom = 455.0
|
||||
text = "Add Coal"
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
[node name="StateChart" type="Node" parent="." unique_id=1880010090]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_7ehwm")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
[node name="Root" type="Node" parent="StateChart" unique_id=1862724482]
|
||||
script = ExtResource("4_ohpt6")
|
||||
|
||||
[node name="Drill" type="Node" parent="StateChart/Root"]
|
||||
[node name="Drill" type="Node" parent="StateChart/Root" unique_id=428332976]
|
||||
script = ExtResource("5_xbwwa")
|
||||
initial_state = NodePath("Drill Has No Coal")
|
||||
|
||||
[node name="Drill Has Coal" type="Node" parent="StateChart/Root/Drill"]
|
||||
[node name="Drill Has Coal" type="Node" parent="StateChart/Root/Drill" unique_id=1319519654]
|
||||
editor_description = "When in this state, the drill has coal and will produce two more coal per round."
|
||||
script = ExtResource("6_n6kwq")
|
||||
|
||||
[node name="On Coal Depleted" type="Node" parent="StateChart/Root/Drill/Drill Has Coal"]
|
||||
[node name="On Coal Depleted" type="Node" parent="StateChart/Root/Drill/Drill Has Coal" unique_id=1451112502]
|
||||
script = ExtResource("7_78ppn")
|
||||
to = NodePath("../../Drill Has No Coal")
|
||||
event = &"coal_depleted"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Drill Has No Coal" type="Node" parent="StateChart/Root/Drill"]
|
||||
[node name="Drill Has No Coal" type="Node" parent="StateChart/Root/Drill" unique_id=1616848461]
|
||||
editor_description = "When in this state, the drill will do nothing."
|
||||
script = ExtResource("6_n6kwq")
|
||||
|
||||
[node name="On Coal Available" type="Node" parent="StateChart/Root/Drill/Drill Has No Coal"]
|
||||
[node name="On Coal Available" type="Node" parent="StateChart/Root/Drill/Drill Has No Coal" unique_id=604312784]
|
||||
script = ExtResource("7_78ppn")
|
||||
to = NodePath("../../Drill Has Coal")
|
||||
event = &"coal_available"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
[node name="GridContainer" type="GridContainer" parent="." unique_id=1245828139]
|
||||
offset_left = 366.0
|
||||
offset_top = 333.0
|
||||
offset_right = 518.0
|
||||
offset_bottom = 389.0
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="GridContainer"]
|
||||
[node name="Label" type="Label" parent="GridContainer" unique_id=469540420]
|
||||
layout_mode = 2
|
||||
text = "Coal mined: "
|
||||
|
||||
[node name="CoalAvailableLabel" type="Label" parent="GridContainer"]
|
||||
[node name="CoalAvailableLabel" type="Label" parent="GridContainer" unique_id=118859305]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="Label2" type="Label" parent="GridContainer"]
|
||||
[node name="Label2" type="Label" parent="GridContainer" unique_id=750042110]
|
||||
layout_mode = 2
|
||||
text = "Coal in drill:"
|
||||
|
||||
[node name="CoalInDrillLabel" type="Label" parent="GridContainer"]
|
||||
[node name="CoalInDrillLabel" type="Label" parent="GridContainer" unique_id=1230109760]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="Info" type="Label" parent="."]
|
||||
[node name="Info" type="Label" parent="." unique_id=24109398]
|
||||
offset_left = 13.0
|
||||
offset_top = 22.0
|
||||
offset_right = 322.0
|
||||
|
||||
Reference in New Issue
Block a user