Browse Source

Update finite state machine demo for 4.0.rc4 (#850)

Co-authored-by: Hugo Locurcio <[email protected]>
James Tucker 2 years ago
parent
commit
e03d6abbc8

+ 0 - 1
2d/finite_state_machine/Demo.tscn

@@ -79,6 +79,5 @@ layout_mode = 0
 
 
 [node name="ControlsPanel" parent="Control" instance=ExtResource("4")]
 [node name="ControlsPanel" parent="Control" instance=ExtResource("4")]
 layout_mode = 1
 layout_mode = 1
-grow_horizontal = 0
 
 
 [editable path="Player"]
 [editable path="Player"]

+ 1 - 1
2d/finite_state_machine/README.md

@@ -6,7 +6,7 @@ pushdown automaton.
 
 
 Language: GDScript
 Language: GDScript
 
 
-Renderer: GLES 2
+Renderer: Compatibility
 
 
 Check out this demo on the asset library: https://godotengine.org/asset-library/asset/516
 Check out this demo on the asset library: https://godotengine.org/asset-library/asset/516
 
 

+ 25 - 20
2d/finite_state_machine/debug/ControlsPanel.tscn

@@ -4,32 +4,37 @@
 anchors_preset = 1
 anchors_preset = 1
 anchor_left = 1.0
 anchor_left = 1.0
 anchor_right = 1.0
 anchor_right = 1.0
-offset_left = -220.0
-offset_bottom = 170.0
+offset_left = -150.0
+offset_bottom = 171.0
+grow_horizontal = 0
 
 
-[node name="Keys" type="Label" parent="."]
-anchors_preset = 15
-anchor_right = 1.0
-anchor_bottom = 1.0
-offset_left = 10.0
-offset_top = 10.0
-offset_right = -10.0
-offset_bottom = -10.0
-text = "Shoot:
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -56.5
+offset_top = -65.0
+offset_right = 56.5
+offset_bottom = 65.0
+grow_horizontal = 2
+grow_vertical = 2
+
+[node name="Actions" type="Label" parent="HBoxContainer"]
+layout_mode = 2
+text = "Move:
+Shoot:
 Attack:
 Attack:
 Stagger:
 Stagger:
 Jump:
 Jump:
 Sprint:"
 Sprint:"
 
 
-[node name="Keys2" type="Label" parent="."]
-anchors_preset = 15
-anchor_right = 1.0
-anchor_bottom = 1.0
-offset_left = 10.0
-offset_top = 10.0
-offset_right = -10.0
-offset_bottom = -10.0
-text = "R
+[node name="Keys" type="Label" parent="HBoxContainer"]
+layout_mode = 2
+text = "WASD
+R
 F
 F
 X
 X
 Space
 Space

+ 22 - 19
2d/finite_state_machine/debug/StatesStackDiplayer.tscn

@@ -7,28 +7,31 @@ offset_right = 210.0
 offset_bottom = 170.0
 offset_bottom = 170.0
 script = ExtResource("1")
 script = ExtResource("1")
 
 
-[node name="Title" type="Label" parent="."]
-anchors_preset = 5
-anchor_left = 0.5
-anchor_right = 0.5
-offset_left = -105.0
-offset_right = 105.0
-offset_bottom = 40.0
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+
+[node name="Title" type="Label" parent="VBoxContainer"]
+layout_mode = 2
 text = "Pushown"
 text = "Pushown"
 uppercase = true
 uppercase = true
 
 
-[node name="States" type="Label" parent="."]
-offset_left = 20.0
-offset_top = 50.0
-offset_right = 190.0
-offset_bottom = 170.0
-text = "Jump
-Test"
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
+layout_mode = 2
 
 
-[node name="Numbers" type="Label" parent="."]
-offset_left = 20.0
-offset_top = 50.0
-offset_right = 190.0
-offset_bottom = 170.0
+[node name="Numbers" type="Label" parent="VBoxContainer/HBoxContainer"]
+unique_name_in_owner = true
+layout_mode = 2
 text = "1.
 text = "1.
 2."
 2."
+horizontal_alignment = 2
+
+[node name="States" type="Label" parent="VBoxContainer/HBoxContainer"]
+unique_name_in_owner = true
+layout_mode = 2
+text = "Jump
+Test"

+ 2 - 2
2d/finite_state_machine/debug/states_stack_displayer.gd

@@ -10,5 +10,5 @@ func _process(_delta):
 		states_names += String(state.get_name()) + "\n"
 		states_names += String(state.get_name()) + "\n"
 		numbers += str(index) + "\n"
 		numbers += str(index) + "\n"
 		index += 1
 		index += 1
-	$States.text = states_names
-	$Numbers.text = numbers
+	%States.text = states_names
+	%Numbers.text = numbers

+ 1 - 0
2d/finite_state_machine/fonts/SourceCodePro-Black.ttf.import

@@ -18,6 +18,7 @@ generate_mipmaps=false
 multichannel_signed_distance_field=false
 multichannel_signed_distance_field=false
 msdf_pixel_range=8
 msdf_pixel_range=8
 msdf_size=48
 msdf_size=48
+allow_system_fallback=true
 force_autohinter=false
 force_autohinter=false
 hinting=1
 hinting=1
 subpixel_positioning=1
 subpixel_positioning=1

+ 1 - 0
2d/finite_state_machine/fonts/SourceCodePro-Bold.ttf.import

@@ -18,6 +18,7 @@ generate_mipmaps=false
 multichannel_signed_distance_field=false
 multichannel_signed_distance_field=false
 msdf_pixel_range=8
 msdf_pixel_range=8
 msdf_size=48
 msdf_size=48
+allow_system_fallback=true
 force_autohinter=false
 force_autohinter=false
 hinting=1
 hinting=1
 subpixel_positioning=1
 subpixel_positioning=1

+ 1 - 1
2d/finite_state_machine/icon.png.import

@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.cte
 [params]
 [params]
 
 
 compress/mode=0
 compress/mode=0
+compress/high_quality=false
 compress/lossy_quality=0.7
 compress/lossy_quality=0.7
 compress/hdr_compression=1
 compress/hdr_compression=1
-compress/bptc_ldr=0
 compress/normal_map=0
 compress/normal_map=0
 compress/channel_pack=0
 compress/channel_pack=0
 mipmaps/generate=false
 mipmaps/generate=false

+ 6 - 2
2d/finite_state_machine/player/Player.tscn

@@ -103,10 +103,14 @@ polygon = PackedVector2Array(-20, 0, -20, -20, 20, -20, 20, 0)
 
 
 [node name="StateNameDisplayer" type="Label" parent="."]
 [node name="StateNameDisplayer" type="Label" parent="."]
 offset_left = -109.0
 offset_left = -109.0
-offset_top = -172.0
+offset_top = -180.0
 offset_right = 110.0
 offset_right = 110.0
-offset_bottom = -138.0
+offset_bottom = -143.0
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 8
+theme_override_font_sizes/font_size = 24
 text = "Idle"
 text = "Idle"
+horizontal_alignment = 1
 uppercase = true
 uppercase = true
 script = ExtResource("15")
 script = ExtResource("15")
 
 

+ 1 - 1
2d/finite_state_machine/player/body.png.import

@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/body.png-313f6363670a5852a7b7126ab476d8b1.cte
 [params]
 [params]
 
 
 compress/mode=0
 compress/mode=0
+compress/high_quality=false
 compress/lossy_quality=0.7
 compress/lossy_quality=0.7
 compress/hdr_compression=1
 compress/hdr_compression=1
-compress/bptc_ldr=0
 compress/normal_map=0
 compress/normal_map=0
 compress/channel_pack=0
 compress/channel_pack=0
 mipmaps/generate=false
 mipmaps/generate=false

+ 1 - 1
2d/finite_state_machine/player/shadow.png.import

@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/shadow.png-493c4635eca1ce8bdece629560617dc7.c
 [params]
 [params]
 
 
 compress/mode=0
 compress/mode=0
+compress/high_quality=false
 compress/lossy_quality=0.7
 compress/lossy_quality=0.7
 compress/hdr_compression=1
 compress/hdr_compression=1
-compress/bptc_ldr=0
 compress/normal_map=0
 compress/normal_map=0
 compress/channel_pack=0
 compress/channel_pack=0
 mipmaps/generate=false
 mipmaps/generate=false

+ 2 - 2
2d/finite_state_machine/player/states/motion/in_air/jump.gd

@@ -60,8 +60,8 @@ func move_horizontally(delta, direction):
 	var steering_velocity = (target_velocity - horizontal_velocity).normalized() * air_steering_power
 	var steering_velocity = (target_velocity - horizontal_velocity).normalized() * air_steering_power
 	horizontal_velocity += steering_velocity
 	horizontal_velocity += steering_velocity
 
 
-	# TODO: This information should be set to the CharacterBody properties instead of arguments.
-	owner.move_and_slide(horizontal_velocity)
+	owner.velocity = horizontal_velocity
+	owner.move_and_slide()
 
 
 
 
 func animate_jump_height(delta):
 func animate_jump_height(delta):

+ 5 - 6
2d/finite_state_machine/player/states/motion/on_ground/move.gd

@@ -18,11 +18,11 @@ func handle_input(event):
 
 
 func update(_delta):
 func update(_delta):
 	var input_direction = get_input_direction()
 	var input_direction = get_input_direction()
-	if not input_direction:
+	if input_direction.is_zero_approx():
 		emit_signal("finished", "idle")
 		emit_signal("finished", "idle")
 	update_look_direction(input_direction)
 	update_look_direction(input_direction)
 
 
-	if Input.is_action_pressed(&"run"):
+	if Input.is_action_pressed("run"):
 		speed = max_run_speed
 		speed = max_run_speed
 	else:
 	else:
 		speed = max_walk_speed
 		speed = max_walk_speed
@@ -35,9 +35,8 @@ func update(_delta):
 
 
 
 
 func move(speed, direction):
 func move(speed, direction):
-	velocity = direction.normalized() * speed
-	# TODO: This information should be set to the CharacterBody properties instead of arguments.
-	owner.move_and_slide(velocity, Vector2(), 5, 2)
-	if owner.get_slide_count() == 0:
+	owner.velocity = direction.normalized() * speed
+	owner.move_and_slide()
+	if owner.get_slide_collision_count() == 0:
 		return
 		return
 	return owner.get_slide_collision(0)
 	return owner.get_slide_collision(0)

+ 1 - 1
2d/finite_state_machine/player/weapon/sword.gd

@@ -96,7 +96,7 @@ func _on_body_entered(body):
 
 
 
 
 func _on_animation_finished(_name):
 func _on_animation_finished(_name):
-	if not attack_current:
+	if attack_current.is_empty():
 		return
 		return
 
 
 	if attack_input_state == AttackInputStates.REGISTERED and combo_count < MAX_COMBO_COUNT:
 	if attack_input_state == AttackInputStates.REGISTERED and combo_count < MAX_COMBO_COUNT:

+ 1 - 1
2d/finite_state_machine/player/weapon/sword.png.import

@@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/sword.png-fc7f0084cdf333c826eda2b33f2ec3cc.ct
 [params]
 [params]
 
 
 compress/mode=0
 compress/mode=0
+compress/high_quality=false
 compress/lossy_quality=0.7
 compress/lossy_quality=0.7
 compress/hdr_compression=1
 compress/hdr_compression=1
-compress/bptc_ldr=0
 compress/normal_map=0
 compress/normal_map=0
 compress/channel_pack=0
 compress/channel_pack=0
 mipmaps/generate=false
 mipmaps/generate=false

+ 22 - 13
2d/finite_state_machine/project.godot

@@ -29,63 +29,72 @@ window/stretch/aspect="expand"
 
 
 move_left={
 move_left={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777231,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
-, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
+, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":113,"echo":false,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 move_up={
 move_up={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
-, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
+, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":122,"echo":false,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 move_right={
 move_right={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777233,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
-, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
+, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 move_down={
 move_down={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
-, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
+, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
 , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 fire={
 fire={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":82,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":82,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":7,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":7,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 run={
 run={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777237,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194325,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 jump={
 jump={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 simulate_damage={
 simulate_damage={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":88,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":88,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
 attack={
 attack={
 "deadzone": 0.5,
 "deadzone": 0.5,
-"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
+"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
 , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
 ]
 ]
 }
 }
+
+[physics]
+
+common/physics_ticks_per_second=120
+
+[rendering]
+
+renderer/rendering_method="gl_compatibility"
+renderer/rendering_method.mobile="gl_compatibility"

+ 2 - 2
2d/finite_state_machine/state_machine/state_machine.gd

@@ -20,7 +20,7 @@ var _active = false:
 		_active = value
 		_active = value
 		set_active(value)
 		set_active(value)
 
 
-func _ready():
+func _enter_tree():
 	if start_state.is_empty():
 	if start_state.is_empty():
 		start_state = get_child(0).get_path()
 		start_state = get_child(0).get_path()
 	for child in get_children():
 	for child in get_children():
@@ -31,7 +31,7 @@ func _ready():
 
 
 
 
 func initialize(initial_state):
 func initialize(initial_state):
-	set_active(true)
+	_active = true
 	states_stack.push_front(get_node(initial_state))
 	states_stack.push_front(get_node(initial_state))
 	current_state = states_stack[0]
 	current_state = states_stack[0]
 	current_state.enter()
 	current_state.enter()