Skip to content

Commit

Permalink
bug fixed, clear spaces for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed Oct 19, 2022
1 parent 66622d7 commit 89d9caa
Show file tree
Hide file tree
Showing 39 changed files with 1,223 additions and 1,217 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.import/
export.cfg
export_presets.cfg
script_templates/
*.import

# Mono-specific ignores
.mono/
Expand Down
2 changes: 1 addition & 1 deletion Document_cn.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 分层有限状态机 - V 0.9
# 分层有限状态机 - V 1.0

​ 总所周知,状态机是一种很常见的设计模式,这里提供了一个强大易用、可视化编辑的分层有限状态机Godot插件。

Expand Down
2 changes: 1 addition & 1 deletion Document_en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hierarchical Finite State Machine - V 0.9
# Hierarchical Finite State Machine - V 1.0

​ As we all know, state machine is a very common design pattern. Here provide a powerful and easy-to-use Godot plugin for Hierarchical Finite State Machine with visual editing.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hierarchical Finite State Machine - v 0.9
# Hierarchical Finite State Machine - v 1.0

​ As we all know, state machine is a very common design pattern. Here provide a powerful and easy-to-use Godot plugin for Hierarchical Finite State Machine with visual editing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ onready var velocity_length_label :Label = get_node("VelocityLengthLabel")


func _on_HFSM_updated(state:String, delta:float, fsm_path:Array) -> void:
# Move control, different state's move logic are controlled at here.
# Move control, different state's move logic are controlled at here.
var dir := Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
match state:
"idle", "move":
Expand All @@ -34,7 +34,7 @@ func _on_HFSM_updated(state:String, delta:float, fsm_path:Array) -> void:
func _on_HFSM_physics_updated(state:String , delta:float, fsm_path:Array) -> void:
# Display the velocity length.
velocity_length_label.text = str(velocity.length())

func _on_HFSM_entered(state:String, fsm_path:Array) -> void:
# Print the entered state.
print("enter: ", state)
Expand All @@ -45,7 +45,7 @@ func _on_HFSM_entered(state:String, fsm_path:Array) -> void:
if Input.is_action_just_pressed("ui_select"):
velocity.y += jump_speed
hfsm.set_float("velocity_length" ,velocity.length())

func _on_HFSM_transited(from:String, to:String, fsm_path:Array) -> void:
# Print the transit infomation for debug.
print("transit from '%s' to '%s',path :" % [from if from else "null" , to if to else "null"] , fsm_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends "res://addons/hierarchical_finite_state_machine/script/source/state.gd"

###agents list-start# please not modify this line.
const Player = preload("res://addons/hierarchical_finite_state_machine/demo/gds_nested_state_script_style_2d_platform_player/Player.gd")
var player : Player
var player : Player
###agents list-end# please not modify this line.
###nested fsm state-start# please not modify this line.
###nested fsm state-end# please not modify this line.
Expand Down Expand Up @@ -38,7 +38,7 @@ func entry()->void:
#(In order to ensure the function completeness)
#Note that this method will not be called if this state is an exit state
func update(delta:float)->void:
# Move control, different state's move logic are controlled at here.
# Move control, different state's move logic are controlled at here.
var dir := Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")

player.velocity.x = lerp(player.velocity.x , dir * player.move_speed ,delta*player.accel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends "res://addons/hierarchical_finite_state_machine/script/source/state.gd"

###agents list-start# please not modify this line.
const Player = preload("res://addons/hierarchical_finite_state_machine/demo/gds_nested_state_script_style_2d_platform_player/Player.gd")
var player : Player
var player : Player
###agents list-end# please not modify this line.
###nested fsm state-start# please not modify this line.
###nested fsm state-end# please not modify this line.
Expand Down Expand Up @@ -42,13 +42,13 @@ func entry()->void:
#(In order to ensure the function completeness)
#Note that this method will not be called if this state is an exit state
func update(delta:float)->void:
# Move control, different state's move logic are controlled at here.
# Move control, different state's move logic are controlled at here.
var dir := Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")

player.velocity.x = lerp(player.velocity.x , dir * player.move_speed, delta *player. float_horizon_accel)
player.velocity.y += player.gravity * delta
player.velocity = player.move_and_slide(player.velocity,Vector2.UP)

# Set hfsm's variable for transtion condition check.
# Just for the transitions between "move" and "idle".
# Others transitions is controlled by expression conditions, please refer the hfsm's graph for more.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends "res://addons/hierarchical_finite_state_machine/script/source/state.gd"

###agents list-start# please not modify this line.
const Player = preload("res://addons/hierarchical_finite_state_machine/demo/gds_nested_state_script_style_2d_platform_player/Player.gd")
var player : Player
var player : Player
###agents list-end# please not modify this line.
###nested fsm state-start# please not modify this line.
###nested fsm state-end# please not modify this line.
Expand Down Expand Up @@ -38,7 +38,7 @@ func entry()->void:
#(In order to ensure the function completeness)
#Note that this method will not be called if this state is an exit state
func update(delta:float)->void:
# Move control, different state's move logic are controlled at here.
# Move control, different state's move logic are controlled at here.
var dir := Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")

player.velocity.x = lerp(player.velocity.x , dir * player.move_speed ,delta*player.accel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends "res://addons/hierarchical_finite_state_machine/script/source/state.gd"

###agents list start# please not modify this line.
const Player = preload("res://addons/hierarchical_finite_state_machine/demo/test_2d_platform_player/Player.gd")
var player : Player
var player : Player
###agents list end# please not modify this line.
###nested fsm state-start# please not modify this line.
###nested fsm state-end# please not modify this line.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
##############################################################################
# Copyright (C) 2021 Daylily-Zeleen daylily-zeleen@foxmail.com.
#
# Copyright (C) 2021 Daylily-Zeleen daylily-zeleen@foxmail.com.
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Hirerarchical Finite State Machine - Trial Version(HFSM - Trial Version)
#
#
# Hirerarchical Finite State Machine - Trial Version(HFSM - Trial Version)
#
#
# This file is part of HFSM - Trial Version.
#
# HFSM -Triabl Version is free Godot Plugin: you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public License as published
#
# HFSM -Triabl Version is free Godot Plugin: you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public License as published
#by the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
Expand All @@ -34,27 +34,27 @@
#
# 虽然这是HFSM的试用版本,但是几乎包含了完整版本的所有功能(请阅读README.md了解他们的差异)。如果这个
#插件对您有帮助,请考虑通过获取完整版本来支持我。
#
# Sponsor link (赞助链接):
#
# Sponsor link (赞助链接):
# https://afdian.net/@Daylily-Zeleen
# https://godotmarketplace.com/?post_type=product&p=37138
#
#
# @author Daylily-Zeleen
# @email daylily-zeleen@foxmail.com. @qq.com
# @version 0.8(版本号)
# @license GNU Lesser General Public License v3.0 (LGPL-3.0)
#
# https://godotmarketplace.com/?post_type=product&p=37138
#
#
# @author Daylily-Zeleen
# @email daylily-zeleen@foxmail.com. @qq.com
# @version 0.8(版本号)
# @license GNU Lesser General Public License v3.0 (LGPL-3.0)
#
#----------------------------------------------------------------------------
# Remark :
# Remark :
#----------------------------------------------------------------------------
# Change History :
# <Date> | <Version> | <Author> | <Description>
# Change History :
# <Date> | <Version> | <Author> | <Description>
#----------------------------------------------------------------------------
# 2021/04/14 | 0.1 | Daylily-Zeleen | Create file
# 2022/07/2 | 0.8 | Daylily-Zeleen | remove _custom_class_list
# 2021/04/14 | 0.1 | Daylily-Zeleen | Create file
# 2022/07/2 | 0.8 | Daylily-Zeleen | remove _custom_class_list
#----------------------------------------------------------------------------
#
#
##############################################################################
extends EditorInspectorPlugin

Expand Down
Loading

0 comments on commit 89d9caa

Please sign in to comment.