gd,refacto: added state chart addon and namespace cleanup
BIN
godot_state_charts_examples/platformer/breaking_box/break.png
Normal file
After Width: | Height: | Size: 635 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://p8vbysdruo4o"
|
||||
path="res://.godot/imported/break.png-76e3da8567a2ce2ef66cf2a31e3edc5e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/breaking_box/break.png"
|
||||
dest_files=["res://.godot/imported/break.png-76e3da8567a2ce2ef66cf2a31e3edc5e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,54 @@
|
||||
extends StaticBody2D
|
||||
|
||||
signal clicked(node)
|
||||
|
||||
@export var health:int = 3
|
||||
@onready var _state_chart:StateChart = %StateChart
|
||||
@onready var _label:Label = %Label
|
||||
@onready var _detection_shape = %CollisionShape2D
|
||||
@onready var _animation_player = %AnimationPlayer
|
||||
|
||||
func _ready():
|
||||
_label.text = str(health)
|
||||
|
||||
|
||||
func _on_idle_state_entered():
|
||||
# When we enter idle state we play the idle animation
|
||||
_animation_player.play("Idle")
|
||||
|
||||
|
||||
func _on_detection_area_body_entered(_body):
|
||||
# When someone enters the area, reduce the health
|
||||
# and notify the state chart.
|
||||
health = max(0, health-1)
|
||||
_label.text = str(health)
|
||||
_state_chart.set_expression_property("health", health)
|
||||
_state_chart.send_event("health_changed")
|
||||
|
||||
|
||||
func _on_blinking_state_entered():
|
||||
# when we enter blinking state, play the hit animation
|
||||
_animation_player.play("Hit")
|
||||
|
||||
|
||||
func _on_dying_state_entered():
|
||||
# When we enter dying state, play the final death animation
|
||||
_animation_player.play("Break")
|
||||
|
||||
|
||||
func _on_dead_state_entered():
|
||||
# When we enter dead state, we're done and can free the node.
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_animation_player_animation_finished(_anim_name):
|
||||
# Forward animation_finished events to the state chart
|
||||
_state_chart.send_event("animation_finished")
|
||||
|
||||
|
||||
# This is to make the box clickable. Clicking it will show it in the debugger.
|
||||
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)
|
||||
|
@ -0,0 +1 @@
|
||||
uid://b7gcoyovuxkvo
|
@ -0,0 +1,425 @@
|
||||
[gd_scene load_steps=19 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="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="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"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_toibu"]
|
||||
resource_name = "Break"
|
||||
length = 0.3
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("BoxSprite:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("4_jb7vf")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("BoxSprite:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [4]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("BoxSprite:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2),
|
||||
"transitions": PackedFloat32Array(16.5643, 1),
|
||||
"update": 0,
|
||||
"values": [0, 3]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Label:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("BoxCollider:disabled")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("BoxSprite:position")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 8.87654),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -10), Vector2(0, 50)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("BoxSprite:modulate:a")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [1.0, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rc67x"]
|
||||
resource_name = "Hit"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("BoxSprite:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("3_ngvxc")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("BoxSprite:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [2]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("BoxSprite:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Label:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yu346"]
|
||||
resource_name = "Idle"
|
||||
length = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("BoxSprite:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_dixph")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("BoxSprite:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("BoxSprite:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Label:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("BoxCollider:disabled")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_a7q8m"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("BoxSprite:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_dixph")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("BoxSprite:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("BoxSprite:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Label:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("BoxCollider:disabled")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("BoxSprite:position")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -10)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("BoxSprite:modulate")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_t7nrw"]
|
||||
_data = {
|
||||
"Break": SubResource("Animation_toibu"),
|
||||
"Hit": SubResource("Animation_rc67x"),
|
||||
"Idle": SubResource("Animation_yu346"),
|
||||
"RESET": SubResource("Animation_a7q8m")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8vd2b"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jbwph"]
|
||||
size = Vector2(14.5, 2)
|
||||
|
||||
[sub_resource type="Resource" id="Resource_v858x"]
|
||||
script = ExtResource("8_8riiw")
|
||||
expression = "health > 0"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_j86i4"]
|
||||
script = ExtResource("8_8riiw")
|
||||
expression = "health <= 0"
|
||||
|
||||
[node name="BreakingBox" type="StaticBody2D"]
|
||||
input_pickable = true
|
||||
script = ExtResource("1_c2rh2")
|
||||
|
||||
[node name="BoxSprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -10)
|
||||
texture = ExtResource("1_dixph")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -23.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 3.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 10
|
||||
text = "3"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
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")
|
||||
}
|
||||
|
||||
[node name="BoxCollider" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_8vd2b")
|
||||
|
||||
[node name="DetectionArea" type="Area2D" parent="."]
|
||||
position = Vector2(0, -3)
|
||||
collision_layer = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -19)
|
||||
shape = SubResource("RectangleShape2D_jbwph")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_atynw")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
script = ExtResource("5_wouwd")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="On Damage" type="Node" parent="StateChart/Root/Idle"]
|
||||
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"]
|
||||
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"]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Blinking"]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"animation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dying" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[node name="Animation Finished" type="Node" parent="StateChart/Root/Dying"]
|
||||
script = ExtResource("7_1ecad")
|
||||
to = NodePath("../../Dead")
|
||||
event = &"animation_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dead" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("6_p4jwe")
|
||||
|
||||
[connection signal="input_event" from="." to="." method="_on_input_event"]
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
|
||||
[connection signal="body_entered" from="DetectionArea" to="." method="_on_detection_area_body_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Idle" to="." method="_on_idle_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Blinking" to="." method="_on_blinking_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Dying" to="." method="_on_dying_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Dead" to="." method="_on_dead_state_entered"]
|
BIN
godot_state_charts_examples/platformer/breaking_box/hit.png
Normal file
After Width: | Height: | Size: 454 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dq0ww6xvgeap3"
|
||||
path="res://.godot/imported/hit.png-1c36fd330c418d67632dbaced016a36f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/breaking_box/hit.png"
|
||||
dest_files=["res://.godot/imported/hit.png-1c36fd330c418d67632dbaced016a36f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
godot_state_charts_examples/platformer/breaking_box/idle.png
Normal file
After Width: | Height: | Size: 406 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c5dogybcf6yfo"
|
||||
path="res://.godot/imported/idle.png-ceff55276331d87b08aa0aee62d3e6af.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/breaking_box/idle.png"
|
||||
dest_files=["res://.godot/imported/idle.png-ceff55276331d87b08aa0aee62d3e6af.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,36 @@
|
||||
extends Node2D
|
||||
|
||||
## emitted when this checkpoint is clicked with the mouse
|
||||
signal clicked(checkpoint:Node2D)
|
||||
|
||||
## emitted when this checkpoint is activated
|
||||
signal activated(checkpoint:Node2D)
|
||||
|
||||
## emitted when this checkpoint is deactivated
|
||||
signal deactivated(checkpoint:Node2D)
|
||||
|
||||
@onready var _state_chart:StateChart = get_node("StateChart")
|
||||
|
||||
|
||||
func _on_area_2d_input_event(_viewport:Node, event:InputEvent, _shape_idx:int):
|
||||
# if event was left mouse button up, emit clicked signal
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() == false:
|
||||
# print("Checkpoint clicked")
|
||||
clicked.emit(self)
|
||||
|
||||
|
||||
func _on_area_2d_body_entered(body:Node2D):
|
||||
if body.is_in_group("player"):
|
||||
_state_chart.send_event("player_entered")
|
||||
|
||||
|
||||
func _on_area_2d_body_exited(body:Node2D):
|
||||
if body.is_in_group("player"):
|
||||
_state_chart.send_event("player_exited")
|
||||
|
||||
|
||||
func emit_activated():
|
||||
activated.emit(self)
|
||||
|
||||
func emit_deactivated():
|
||||
deactivated.emit(self)
|
@ -0,0 +1 @@
|
||||
uid://ccsukp7vuknqs
|
@ -0,0 +1,343 @@
|
||||
[gd_scene load_steps=19 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="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"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xvggk"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_7vf2w")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_p66ga"]
|
||||
resource_name = "close_flag"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("3_fbg27")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [26]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [25, 0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_w48c8"]
|
||||
resource_name = "idle_no_flag"
|
||||
length = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_7vf2w")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_judeo"]
|
||||
resource_name = "idle_with_flag"
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("2_ns71f")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [10]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0, 9]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_gr2w7"]
|
||||
resource_name = "open_flag"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("3_fbg27")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [26]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0, 25]
|
||||
}
|
||||
|
||||
[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")
|
||||
}
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_06im6"]
|
||||
radius = 18.445
|
||||
height = 59.4
|
||||
|
||||
[sub_resource type="Resource" id="Resource_22wfi"]
|
||||
script = ExtResource("10_fk2fi")
|
||||
state = NodePath("../../../../Player Presence/Absent")
|
||||
metadata/_editor_prop_ptr_state = NodePath("../../../Player Presence/Absent")
|
||||
|
||||
[node name="Checkpoint" type="Node2D"]
|
||||
script = ExtResource("1_jot5v")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_7vf2w")
|
||||
offset = Vector2(0, -32)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_5pqa5")
|
||||
}
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(-2, -26)
|
||||
shape = SubResource("CapsuleShape2D_06im6")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
script = ExtResource("5_a58ma")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
script = ExtResource("6_53g38")
|
||||
|
||||
[node name="Player Presence" type="Node" parent="StateChart/Root"]
|
||||
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"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Player Presence/Absent"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Present")
|
||||
event = &"player_entered"
|
||||
|
||||
[node name="Present" type="Node" parent="StateChart/Root/Player Presence"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Exit" type="Node" parent="StateChart/Root/Player Presence/Present"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Absent")
|
||||
event = &"player_exited"
|
||||
|
||||
[node name="Animation Control" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("6_qkwqk")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Idle"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Expanding")
|
||||
event = &"player_entered"
|
||||
|
||||
[node name="Expanding" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Expanding"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Activated/Expanded")
|
||||
delay_seconds = 0.9
|
||||
|
||||
[node name="Activated" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
script = ExtResource("6_qkwqk")
|
||||
initial_state = NodePath("Expanded")
|
||||
|
||||
[node name="Expanded" type="Node" parent="StateChart/Root/Animation Control/Activated"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="Immediately" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded"]
|
||||
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")
|
||||
|
||||
[node name="On Player Leave" type="Node" parent="StateChart/Root/Animation Control/Activated/Expanded"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Waiting To Retract")
|
||||
event = &"player_exited"
|
||||
|
||||
[node name="Waiting To Retract" type="Node" parent="StateChart/Root/Animation Control/Activated"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 5 s" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../../Retracting")
|
||||
delay_seconds = 5.0
|
||||
|
||||
[node name="On Player Enter" type="Node" parent="StateChart/Root/Animation Control/Activated/Waiting To Retract"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Expanded")
|
||||
event = &"player_entered"
|
||||
|
||||
[node name="Retracting" type="Node" parent="StateChart/Root/Animation Control"]
|
||||
script = ExtResource("7_a74k1")
|
||||
|
||||
[node name="After 1 s" type="Node" parent="StateChart/Root/Animation Control/Retracting"]
|
||||
script = ExtResource("8_7tjvh")
|
||||
to = NodePath("../../Idle")
|
||||
delay_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"]
|
||||
[connection signal="input_event" from="Area2D" to="." method="_on_area_2d_input_event"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Animation Control/Idle" to="AnimationPlayer" method="play" binds= ["idle_no_flag"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Animation Control/Expanding" to="AnimationPlayer" method="play" binds= ["open_flag"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Animation Control/Activated" to="." method="emit_activated"]
|
||||
[connection signal="state_exited" from="StateChart/Root/Animation Control/Activated" to="." method="emit_deactivated"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Animation Control/Activated/Expanded" to="AnimationPlayer" method="play" binds= ["idle_with_flag"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Animation Control/Retracting" to="AnimationPlayer" method="play" binds= ["close_flag"]]
|
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://beoe1hh5aggor"
|
||||
path="res://.godot/imported/checkpoint_flag_out.png-d1302c67d10e0b187eb8c484888649f3.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_flag_out.png"
|
||||
dest_files=["res://.godot/imported/checkpoint_flag_out.png-d1302c67d10e0b187eb8c484888649f3.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dfju87f6rw0nm"
|
||||
path="res://.godot/imported/checkpoint_idle.png-450aa64af9f9812b4e2bfc351c4acc23.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_idle.png"
|
||||
dest_files=["res://.godot/imported/checkpoint_idle.png-450aa64af9f9812b4e2bfc351c4acc23.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
After Width: | Height: | Size: 530 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://4nlen5j7etvq"
|
||||
path="res://.godot/imported/checkpoint_no_flag.png-439157dcb5eca60e80049ff3b7e7a879.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/checkpoint/checkpoint_no_flag.png"
|
||||
dest_files=["res://.godot/imported/checkpoint_no_flag.png-439157dcb5eca60e80049ff3b7e7a879.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
godot_state_charts_examples/platformer/fireworks_box/box.png
Normal file
After Width: | Height: | Size: 399 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://roilgifkgiii"
|
||||
path="res://.godot/imported/box.png-c36de003bc6b3890e50f6a4e0637c2de.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/fireworks_box/box.png"
|
||||
dest_files=["res://.godot/imported/box.png-c36de003bc6b3890e50f6a4e0637c2de.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,24 @@
|
||||
extends Node2D
|
||||
|
||||
signal clicked(node:Node2D)
|
||||
|
||||
@onready var _state_chart:StateChart = $StateChart as StateChart
|
||||
var _counter = 0
|
||||
|
||||
func count_up():
|
||||
_counter += 1
|
||||
_notify()
|
||||
|
||||
func count_down():
|
||||
_counter -= 1
|
||||
_notify()
|
||||
|
||||
func _notify():
|
||||
_state_chart.set_expression_property("counter", _counter)
|
||||
_state_chart.send_event("counter_changed")
|
||||
|
||||
|
||||
func _on_area_2d_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)
|
@ -0,0 +1 @@
|
||||
uid://dn46gqfbbvsnk
|
@ -0,0 +1,244 @@
|
||||
[gd_scene load_steps=18 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="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"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_y5h70"]
|
||||
script = ExtResource("7_tu34q")
|
||||
expression = "counter > 0"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lsbaa"]
|
||||
script = ExtResource("7_tu34q")
|
||||
expression = "counter > 2"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_t7gf7"]
|
||||
script = ExtResource("7_tu34q")
|
||||
expression = "counter == 0"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_0njji"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Box:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Box:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-0.132645]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Box:scale")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("GPUParticles2D:emitting")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_81tef"]
|
||||
resource_name = "explode"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Box:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1), Vector2(0.2, 0.2), Vector2(1e-05, 1e-05)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("GPUParticles2D:emitting")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.2),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yw5k5"]
|
||||
resource_name = "idle"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Box:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_tug1d"]
|
||||
resource_name = "rattle"
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Box:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Box:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.3, 0.5, 0.7, 0.9, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [0.0, -0.132645, 0.263545, -0.139626, -0.261799, -0.122173, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_stxxq"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_0njji"),
|
||||
"explode": SubResource("Animation_81tef"),
|
||||
"idle": SubResource("Animation_yw5k5"),
|
||||
"rattle": SubResource("Animation_tug1d")
|
||||
}
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_c15xx"]
|
||||
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
|
||||
turbulence_noise_scale = 8.14
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4ryt0"]
|
||||
|
||||
[node name="FireworksBox" type="Node2D"]
|
||||
script = ExtResource("1_6vg3k")
|
||||
|
||||
[node name="Box" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -10)
|
||||
texture = ExtResource("1_aido8")
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
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"]
|
||||
script = ExtResource("3_b1cau")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Rattle on Counter" type="Node" parent="StateChart/Root/Idle"]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Rattling")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_y5h70")
|
||||
|
||||
[node name="Rattling" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Explode on Counter" type="Node" parent="StateChart/Root/Rattling"]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Exploding")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_lsbaa")
|
||||
|
||||
[node name="Get back to Idle" type="Node" parent="StateChart/Root/Rattling"]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Idle")
|
||||
event = &"counter_changed"
|
||||
guard = SubResource("Resource_t7gf7")
|
||||
|
||||
[node name="Exploding" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="Die after 4s" type="Node" parent="StateChart/Root/Exploding"]
|
||||
script = ExtResource("6_bf3gq")
|
||||
to = NodePath("../../Dead")
|
||||
delay_seconds = 4.0
|
||||
|
||||
[node name="Dead" type="Node" parent="StateChart/Root"]
|
||||
script = ExtResource("4_ot1ih")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
reset_on_save = false
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_stxxq")
|
||||
}
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
position = Vector2(0, -10)
|
||||
emitting = false
|
||||
amount = 300
|
||||
process_material = SubResource("ParticleProcessMaterial_c15xx")
|
||||
lifetime = 2.81
|
||||
one_shot = true
|
||||
explosiveness = 0.86
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_4ryt0")
|
||||
|
||||
[connection signal="state_entered" from="StateChart/Root/Idle" to="AnimationPlayer" method="play" binds= ["idle"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Rattling" to="AnimationPlayer" method="play" binds= ["rattle"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Exploding" to="AnimationPlayer" method="play" binds= ["explode"]]
|
||||
[connection signal="state_entered" from="StateChart/Root/Dead" to="." method="queue_free"]
|
||||
[connection signal="input_event" from="Area2D" to="." method="_on_area_2d_input_event"]
|
BIN
godot_state_charts_examples/platformer/ninja_frog/full.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bgswg1pgd01d1"
|
||||
path="res://.godot/imported/full.png-a85a82780a54dfe88e1678c76076d884.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/ninja_frog/full.png"
|
||||
dest_files=["res://.godot/imported/full.png-a85a82780a54dfe88e1678c76076d884.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,80 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
## Emitted when this node is clicked with a mouse
|
||||
signal clicked(node:Node2D)
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var _gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
@onready var _sprite: Sprite2D = $Sprite
|
||||
@onready var _state_chart: StateChart = $StateChart
|
||||
@onready var _animation_tree: AnimationTree = $AnimationTree
|
||||
@onready var _animation_state_machine: AnimationNodeStateMachinePlayback = _animation_tree.get("parameters/playback")
|
||||
|
||||
## Flag indicating if the character was on the floor in the last frame.
|
||||
var _was_on_floor:bool = false
|
||||
|
||||
# In all states, move and slide and handle left/right movement and gravity.
|
||||
func _physics_process(delta):
|
||||
|
||||
# handle left/right movement
|
||||
var direction = Input.get_axis("ui_left", "ui_right")
|
||||
if direction:
|
||||
velocity.x = direction * SPEED
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
|
||||
# flip the sprite. we do this before moving, so it flips
|
||||
# even if we stand at a wall
|
||||
if signf(velocity.x) != 0:
|
||||
_sprite.flip_h = velocity.x < 0
|
||||
|
||||
# gravity handled in Grounded and Airborne states
|
||||
move_and_slide()
|
||||
|
||||
# if we are on the floor right now
|
||||
if is_on_floor():
|
||||
velocity.y = 0
|
||||
# if we just touched the floor, notify the state chart
|
||||
if not _was_on_floor:
|
||||
_was_on_floor = true
|
||||
_state_chart.send_event("grounded")
|
||||
else:
|
||||
velocity.y += _gravity * delta
|
||||
# if we just left the floor, notify the state chart
|
||||
if _was_on_floor:
|
||||
_was_on_floor = false
|
||||
_state_chart.send_event("airborne")
|
||||
|
||||
|
||||
# let the state machine know if we are moving or not
|
||||
if velocity.length_squared() <= 0.005:
|
||||
_animation_state_machine.travel("Idle")
|
||||
else:
|
||||
_animation_state_machine.travel("Move")
|
||||
|
||||
# set the velocity to the animation tree, so it can blend between animations
|
||||
_animation_tree["parameters/Move/blend_position"] = signf(velocity.y)
|
||||
|
||||
|
||||
## Called in states that allow jumping, we process jumps only in these.
|
||||
func _on_jump_enabled_state_physics_processing(_delta):
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
velocity.y = JUMP_VELOCITY
|
||||
_state_chart.send_event("jump")
|
||||
|
||||
|
||||
## Called when the jump transition is taken in the double-jump
|
||||
## state. Only used to play the double jump animation.
|
||||
func _on_double_jump_jump():
|
||||
_animation_state_machine.travel("DoubleJump")
|
||||
|
||||
|
||||
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)
|
||||
|
@ -0,0 +1 @@
|
||||
uid://qid37o42he05
|
@ -0,0 +1,275 @@
|
||||
[gd_scene load_steps=28 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="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"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1ethx"]
|
||||
radius = 12.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_uq0h4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 0
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_10ku2"]
|
||||
resource_name = "double_jump"
|
||||
length = 0.4
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [23, 28]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ibg22"]
|
||||
resource_name = "fall"
|
||||
length = 0.1
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [29]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_5rh2e"]
|
||||
resource_name = "idle"
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [12, 22]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_jaga7"]
|
||||
resource_name = "jump"
|
||||
length = 0.1
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [30]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_6odvc"]
|
||||
resource_name = "walk"
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0, 11]
|
||||
}
|
||||
|
||||
[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")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_k3ia7"]
|
||||
animation = &"double_jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_iie7f"]
|
||||
animation = &"idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_oetyn"]
|
||||
animation = &"jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gw83y"]
|
||||
animation = &"walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_iq3nb"]
|
||||
animation = &"fall"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_o7w1c"]
|
||||
blend_point_0/node = SubResource("AnimationNodeAnimation_oetyn")
|
||||
blend_point_0/pos = -1.0
|
||||
blend_point_1/node = SubResource("AnimationNodeAnimation_gw83y")
|
||||
blend_point_1/pos = 0.0
|
||||
blend_point_2/node = SubResource("AnimationNodeAnimation_iq3nb")
|
||||
blend_point_2/pos = 1.0
|
||||
blend_mode = 1
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_i3ow4"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_a52qu"]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_1q7sj"]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4cnci"]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ddbej"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_ckafx"]
|
||||
states/DoubleJump/node = SubResource("AnimationNodeAnimation_k3ia7")
|
||||
states/DoubleJump/position = Vector2(767.5, 63.4141)
|
||||
states/End/position = Vector2(962, 49)
|
||||
states/Idle/node = SubResource("AnimationNodeAnimation_iie7f")
|
||||
states/Idle/position = Vector2(342.5, 63.625)
|
||||
states/Move/node = SubResource("AnimationNodeBlendSpace1D_o7w1c")
|
||||
states/Move/position = Vector2(575.5, 62.7813)
|
||||
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"]]
|
||||
input_pickable = true
|
||||
script = ExtResource("1_xi1lh")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -15)
|
||||
shape = SubResource("CapsuleShape2D_1ethx")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_au2ov")
|
||||
}
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("7_fehuj")
|
||||
offset = Vector2(0, -12)
|
||||
hframes = 31
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
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="."]
|
||||
script = ExtResource("3_qw75p")
|
||||
track_in_editor = true
|
||||
|
||||
[node name="Root" type="Node" parent="StateChart"]
|
||||
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"]
|
||||
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"]
|
||||
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"]
|
||||
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"]
|
||||
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"]
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../Grounded")
|
||||
event = &"grounded"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="CoyoteJumpEnabled" type="Node" parent="StateChart/Root/Airborne"]
|
||||
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"]
|
||||
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"]
|
||||
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"]
|
||||
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"]
|
||||
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."
|
||||
script = ExtResource("9_wswdv")
|
||||
to = NodePath("../../CannotJump")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="CannotJump" type="Node" parent="StateChart/Root/Airborne"]
|
||||
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")
|
||||
|
||||
[connection signal="input_event" from="." to="." method="_on_input_event"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Grounded" to="." method="_on_jump_enabled_state_physics_processing"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/CoyoteJumpEnabled" to="." method="_on_jump_enabled_state_physics_processing"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/DoubleJumpEnabled" to="." method="_on_jump_enabled_state_physics_processing"]
|
||||
[connection signal="taken" from="StateChart/Root/Airborne/DoubleJumpEnabled/On Jump" to="." method="_on_double_jump_jump"]
|
94
godot_state_charts_examples/platformer/platformer_demo.tscn
Normal file
BIN
godot_state_charts_examples/platformer/terrain/green.png
Normal file
After Width: | Height: | Size: 543 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bap00a5gcipy6"
|
||||
path="res://.godot/imported/green.png-7e931e8924aaf6f1ff626e30e2c63319.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/terrain/green.png"
|
||||
dest_files=["res://.godot/imported/green.png-7e931e8924aaf6f1ff626e30e2c63319.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
godot_state_charts_examples/platformer/terrain/terrain_tiles.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d2evtvw3l7jug"
|
||||
path="res://.godot/imported/terrain_tiles.png-2247cd6621fc9988b0ae044edcccf620.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://godot_state_charts_examples/platformer/terrain/terrain_tiles.png"
|
||||
dest_files=["res://.godot/imported/terrain_tiles.png-2247cd6621fc9988b0ae044edcccf620.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -0,0 +1,199 @@
|
||||
[gd_resource type="TileSet" load_steps=6 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"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_8w8gx"]
|
||||
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
|
||||
0:0/0/terrains_peering_bit/bottom_side = 0
|
||||
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
|
||||
1:0/0/terrains_peering_bit/bottom_side = 0
|
||||
1:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
1:0/0/terrains_peering_bit/left_side = 0
|
||||
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
|
||||
1:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
1:1/0/terrains_peering_bit/left_side = 0
|
||||
1:1/0/terrains_peering_bit/top_left_corner = 0
|
||||
1:1/0/terrains_peering_bit/top_side = 0
|
||||
1:1/0/terrains_peering_bit/top_right_corner = 0
|
||||
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
|
||||
2:1/0/terrains_peering_bit/left_side = 0
|
||||
2:1/0/terrains_peering_bit/top_left_corner = 0
|
||||
2:1/0/terrains_peering_bit/top_side = 0
|
||||
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
|
||||
2:2/0/terrains_peering_bit/top_side = 0
|
||||
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
|
||||
2:0/0/terrains_peering_bit/left_side = 0
|
||||
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
|
||||
0:1/0/terrains_peering_bit/bottom_side = 0
|
||||
0:1/0/terrains_peering_bit/top_side = 0
|
||||
0:1/0/terrains_peering_bit/top_right_corner = 0
|
||||
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
|
||||
0:2/0/terrains_peering_bit/top_right_corner = 0
|
||||
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
|
||||
1:2/0/terrains_peering_bit/top_left_corner = 0
|
||||
1:2/0/terrains_peering_bit/top_side = 0
|
||||
1:2/0/terrains_peering_bit/top_right_corner = 0
|
||||
|
||||
[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
|
||||
physics_layer_0/physics_material = SubResource("PhysicsMaterial_8w8gx")
|
||||
terrain_set_0/mode = 0
|
||||
terrain_set_0/terrain_0/name = "Stuff"
|
||||
terrain_set_0/terrain_0/color = Color(0.501961, 0.345098, 0.25098, 1)
|
||||
sources/0 = SubResource("TileSetAtlasSource_p8in1")
|
||||
sources/2 = SubResource("TileSetAtlasSource_gpldh")
|