Removed state machine for behavior trees

- Added Font Awesome Support
This commit is contained in:
Tony Bark 2023-03-14 06:30:58 -04:00
parent b133ee2680
commit c46d0e27e4
161 changed files with 7082 additions and 1083 deletions

49
examples/simple_ai_logic/env/tree.gd vendored Normal file
View file

@ -0,0 +1,49 @@
extends Node2D
#------------------------------------------
# Signaux
#------------------------------------------
#------------------------------------------
# Exports
#------------------------------------------
@export var max_log_count:int = 3
#------------------------------------------
# Variables publiques
#------------------------------------------
#------------------------------------------
# Variables privées
#------------------------------------------
@onready var remaining_logs:int = max_log_count
#------------------------------------------
# Fonctions Godot redéfinies
#------------------------------------------
func _draw():
var poly = $ShapeFull/Leaves.polygon
for i in range(1 , poly.size()):
draw_line(poly[i-1] , poly[i], Color.BLACK , 1)
draw_line(poly[poly.size() - 1] , poly[0], Color.BLACK , 1)
#------------------------------------------
# Fonctions publiques
#------------------------------------------
func has_logs() -> bool:
return remaining_logs > 0
func cut_log() -> void:
if remaining_logs > 0:
remaining_logs -= 1
if remaining_logs == 0:
queue_free()
#------------------------------------------
# Fonctions privées
#------------------------------------------

27
examples/simple_ai_logic/env/tree.tscn vendored Normal file
View file

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=3]
[ext_resource type="Script" path="res://examples/simple_ai_logic/env/tree.gd" id="1_r2ta2"]
[sub_resource type="Gradient" id="Gradient_aa3nm"]
colors = PackedColorArray(0.408848, 0.73338, 3.85046e-07, 1, 1, 1, 1, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_2o5uu"]
frequency = 0.025
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_0hflj"]
color_ramp = SubResource("Gradient_aa3nm")
noise = SubResource("FastNoiseLite_2o5uu")
[node name="Tree" type="Node2D" groups=["tree"]]
script = ExtResource("1_r2ta2")
[node name="ShapeFull" type="Node2D" parent="."]
[node name="Base" type="Polygon2D" parent="ShapeFull"]
color = Color(0.270588, 0.141176, 0, 1)
polygon = PackedVector2Array(-15, 7, -15, 7, 11, 7, 11, 7, 11, 7, 1, -6, 1, -6, 1, -6, 6, -38, -4, -38, -4, -38, -4, -38)
[node name="Leaves" type="Polygon2D" parent="ShapeFull"]
color = Color(0.121569, 0.301961, 0.0470588, 1)
texture = SubResource("NoiseTexture2D_0hflj")
polygon = PackedVector2Array(-3, -22, -3, -22, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -11, -26, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -18, -32, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -39, -23, -47, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -18, -60, -21, -76, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -22, -86, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, -7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 7, -95, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 19, -91, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 25, -84, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -69, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 29, -57, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 30, -49, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 33, -43, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 34, -36, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 31, -31, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 20, -25, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21, 7, -21)

View file

@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://i4372roabk7a"]
[node name="Warehouse" type="Node2D" groups=["warehouse"]]
[node name="Shape" type="Polygon2D" parent="."]
position = Vector2(0, 7)
scale = Vector2(0.28841, 0.28841)
color = Color(0.270588, 0.145098, 0.0117647, 1)
polygon = PackedVector2Array(-110.953, 0, 232.308, 0, 232.308, -225.374, 138.691, -298.187, -180.299, -218.439, -110.953, -218.439)