Demo: Add player idle and move states

This commit is contained in:
Serhii Snitsaruk 2024-01-30 17:08:50 +01:00
parent 828f4dbad5
commit 4719c77f94
11 changed files with 416 additions and 276 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://ooigbfhfy4wa"] [gd_scene load_steps=20 format=3 uid="uid://ooigbfhfy4wa"]
[ext_resource type="Texture2D" uid="uid://dlo1ine6p5di4" path="res://demo/assets/agent_bobby.png" id="1_1u51b"] [ext_resource type="Texture2D" uid="uid://dlo1ine6p5di4" path="res://demo/assets/agent_bobby.png" id="1_1u51b"]
[ext_resource type="Script" path="res://demo/agents/scripts/agent_base.gd" id="1_n8vy2"] [ext_resource type="Script" path="res://demo/agents/scripts/agent_base.gd" id="1_n8vy2"]
@ -2146,9 +2146,8 @@ _data = {
"walk": SubResource("Animation_fh06e") "walk": SubResource("Animation_fh06e")
} }
[sub_resource type="BlackboardPlan" id="BlackboardPlan_v0ck1"] [node name="AgentBase" type="CharacterBody2D"]
collision_layer = 0
[node name="Agent" type="CharacterBody2D"]
script = ExtResource("1_n8vy2") script = ExtResource("1_n8vy2")
[node name="Root" type="Node2D" parent="."] [node name="Root" type="Node2D" parent="."]
@ -2209,6 +2208,8 @@ region_rect = Rect2(300, 0, 100, 70)
[node name="Hitbox" type="Area2D" parent="Root"] [node name="Hitbox" type="Area2D" parent="Root"]
position = Vector2(50, 0) position = Vector2(50, 0)
collision_layer = 0
collision_mask = 4
script = ExtResource("5_taq6b") script = ExtResource("5_taq6b")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Root/Hitbox"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Root/Hitbox"]
@ -2217,6 +2218,8 @@ debug_color = Color(0.933131, 0.0801983, 0.605982, 0.42)
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="Hurtbox" type="Area2D" parent="Root" node_paths=PackedStringArray("health")] [node name="Hurtbox" type="Area2D" parent="Root" node_paths=PackedStringArray("health")]
collision_layer = 4
collision_mask = 0
script = ExtResource("6_jnvxm") script = ExtResource("6_jnvxm")
health = NodePath("../../Health") health = NodePath("../../Health")
@ -2238,6 +2241,3 @@ libraries = {
"": SubResource("AnimationLibrary_ws2ti") "": SubResource("AnimationLibrary_ws2ti")
} }
autoplay = "idle" autoplay = "idle"
[node name="BTPlayer" type="BTPlayer" parent="."]
blackboard_plan = SubResource("BlackboardPlan_v0ck1")

View File

@ -1,5 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://d07ag5dcje13i"]
[ext_resource type="PackedScene" uid="uid://ooigbfhfy4wa" path="res://demo/agents/agent_base.tscn" id="1_aybxr"]
[node name="AgentPlayer" instance=ExtResource("1_aybxr")]

View File

@ -0,0 +1,17 @@
extends LimboState
## Idle state.
@export var animation_player: AnimationPlayer
@export var animation: StringName
func _enter() -> void:
animation_player.play(animation)
func _update(_delta: float) -> void:
var horizontal_move: float = Input.get_axis(&"move_left", &"move_right")
var vertical_move: float = Input.get_axis(&"move_up", &"move_down")
if horizontal_move != 0.0 or vertical_move != 0.0:
get_root().dispatch(EVENT_FINISHED)

View File

@ -0,0 +1,23 @@
extends LimboState
const VERTICAL_FACTOR := 0.8
## Move state.
@export var animation_player: AnimationPlayer
@export var animation: StringName
@export var speed: float = 500.0
func _enter() -> void:
animation_player.play(animation)
func _update(_delta: float) -> void:
var horizontal_move: float = Input.get_axis(&"move_left", &"move_right")
var vertical_move: float = Input.get_axis(&"move_up", &"move_down")
agent.velocity = lerp(agent.velocity, Vector2(horizontal_move, vertical_move * VERTICAL_FACTOR) * speed, 0.2)
agent.move_and_slide()
if horizontal_move == 0.0 and vertical_move == 0.0:
get_root().dispatch(EVENT_FINISHED)

View File

@ -0,0 +1,18 @@
extends "res://demo/agents/scripts/agent_base.gd"
## Player.
@onready var limbo_hsm: LimboHSM = $LimboHSM
@onready var idle_state: LimboState = $LimboHSM/IdleState
@onready var move_state: LimboState = $LimboHSM/MoveState
func _ready() -> void:
_init_state_machine()
func _init_state_machine() -> void:
limbo_hsm.add_transition(idle_state, move_state, idle_state.EVENT_FINISHED)
limbo_hsm.add_transition(move_state, idle_state, move_state.EVENT_FINISHED)
limbo_hsm.initialize(self)
limbo_hsm.set_active(true)

View File

@ -0,0 +1,21 @@
[gd_scene load_steps=5 format=3 uid="uid://d07ag5dcje13i"]
[ext_resource type="PackedScene" uid="uid://ooigbfhfy4wa" path="res://demo/agents/agent_base.tscn" id="1_mswd4"]
[ext_resource type="Script" path="res://demo/agents/player/player.gd" id="2_24nyi"]
[ext_resource type="Script" path="res://demo/agents/player/idle_state.gd" id="2_moi60"]
[ext_resource type="Script" path="res://demo/agents/player/move_state.gd" id="3_bxpc0"]
[node name="Player" instance=ExtResource("1_mswd4")]
script = ExtResource("2_24nyi")
[node name="LimboHSM" type="LimboHSM" parent="." index="4"]
[node name="IdleState" type="LimboState" parent="LimboHSM" index="0" node_paths=PackedStringArray("animation_player")]
script = ExtResource("2_moi60")
animation_player = NodePath("../../AnimationPlayer")
animation = &"idle"
[node name="MoveState" type="LimboState" parent="LimboHSM" index="1" node_paths=PackedStringArray("animation_player")]
script = ExtResource("3_bxpc0")
animation_player = NodePath("../../AnimationPlayer")
animation = &"walk"

View File

@ -3,8 +3,8 @@ extends CharacterBody2D
## Base agent script. ## Base agent script.
@onready var animation_player: AnimationPlayer = $AnimationPlayer @onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var bt_player: BTPlayer = $BTPlayer
@onready var health: Health = $Health @onready var health: Health = $Health
@onready var root: Node2D = $Root
func _ready() -> void: func _ready() -> void:
@ -12,10 +12,27 @@ func _ready() -> void:
health.death.connect(_die) health.death.connect(_die)
func _physics_process(_delta: float) -> void:
_update_facing()
func _update_facing() -> void:
if velocity.x > 0.0 and root.scale.x < 0.0:
root.scale.x = 1.0;
if velocity.x < 0.0 and root.scale.x > 0.0:
root.scale.x = -1.0;
func _damaged(_amount: float) -> void: func _damaged(_amount: float) -> void:
animation_player.play(&"hit") animation_player.play(&"hurt")
func _die() -> void: func _die() -> void:
animation_player.play(&"death") animation_player.play(&"death")
bt_player.active = false
for child in get_children():
if child is BTPlayer or child is LimboHSM:
child.set_active(false)
await get_tree().create_timer(10.0).timeout
queue_free()

View File

@ -5,6 +5,7 @@ extends Area2D
@export var health: Health @export var health: Health
func take_damage(amount: float, source: Area2D) -> void: func take_damage(amount: float, source: Area2D) -> void:
if source.owner == owner: if source.owner == owner:
# Don't damage yourself. # Don't damage yourself.

View File

@ -0,0 +1,256 @@
[gd_scene load_steps=2 format=3 uid="uid://dt2jlrqffpyw"]
[ext_resource type="Texture2D" uid="uid://65b6yuobhxf8" path="res://demo/assets/env_clouds.png" id="1_eigiy"]
[node name="Clouds" type="Node2D"]
modulate = Color(1, 1, 1, 0.792157)
position = Vector2(-1998, -1508)
metadata/_edit_lock_ = true
[node name="Cloud1" type="Sprite2D" parent="."]
position = Vector2(764, 358)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud13" type="Sprite2D" parent="."]
position = Vector2(4005, 2983)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud5" type="Sprite2D" parent="."]
position = Vector2(-152, 2723)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud6" type="Sprite2D" parent="."]
position = Vector2(3293, 936)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud2" type="Sprite2D" parent="."]
position = Vector2(85, 1505)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud16" type="Sprite2D" parent="."]
position = Vector2(3434, 3542)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud7" type="Sprite2D" parent="."]
position = Vector2(1380, 3802)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud3" type="Sprite2D" parent="."]
position = Vector2(503, 1222)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud14" type="Sprite2D" parent="."]
position = Vector2(4174, 3309)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud15" type="Sprite2D" parent="."]
position = Vector2(4695, 2800)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud8" type="Sprite2D" parent="."]
position = Vector2(152, 3383)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud4" type="Sprite2D" parent="."]
position = Vector2(164, 1669)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud9" type="Sprite2D" parent="."]
position = Vector2(328, 3474)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud10" type="Sprite2D" parent="."]
position = Vector2(933, 515)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud12" type="Sprite2D" parent="."]
position = Vector2(4570, 1222)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud11" type="Sprite2D" parent="."]
position = Vector2(3784, 345)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud17" type="Sprite2D" parent="."]
position = Vector2(-2737.13, 367.814)
scale = Vector2(1.35085, 1.15254)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud18" type="Sprite2D" parent="."]
position = Vector2(-1254.92, 3539.61)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud19" type="Sprite2D" parent="."]
position = Vector2(-2912.7, 1260.29)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud20" type="Sprite2D" parent="."]
position = Vector2(-3251.5, 3437.56)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud21" type="Sprite2D" parent="."]
position = Vector2(-3181.26, 3581.44)
scale = Vector2(0.949153, 0.949153)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud22" type="Sprite2D" parent="."]
position = Vector2(-420.856, 367.017)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud23" type="Sprite2D" parent="."]
position = Vector2(-1493, 3040)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud24" type="Sprite2D" parent="."]
position = Vector2(-510, 2429)
scale = Vector2(1.15254, 1.15254)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud25" type="Sprite2D" parent="."]
position = Vector2(-712, 1373)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud26" type="Sprite2D" parent="."]
position = Vector2(-269, 2004)
scale = Vector2(0.79661, 0.79661)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud27" type="Sprite2D" parent="."]
position = Vector2(-1656, 2353)
scale = Vector2(0.949153, 0.949153)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud28" type="Sprite2D" parent="."]
position = Vector2(-461, 1787)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud29" type="Sprite2D" parent="."]
position = Vector2(3890, 2612.5)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud30" type="Sprite2D" parent="."]
position = Vector2(3832, 1394.5)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud31" type="Sprite2D" parent="."]
position = Vector2(3472, 3106)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud32" type="Sprite2D" parent="."]
position = Vector2(3095, 2689.5)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud33" type="Sprite2D" parent="."]
position = Vector2(4016, 1558.5)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud34" type="Sprite2D" parent="."]
position = Vector2(3863, 1375)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud35" type="Sprite2D" parent="."]
position = Vector2(3521.25, 3087)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud36" type="Sprite2D" parent="."]
position = Vector2(3609.25, 3161)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud37" type="Sprite2D" parent="."]
visible = false
position = Vector2(3754.25, 1447)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud38" type="Sprite2D" parent="."]
visible = false
position = Vector2(2915.25, 2833)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud39" type="Sprite2D" parent="."]
visible = false
position = Vector2(3270.25, 2207)
texture = ExtResource("1_eigiy")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)

View File

@ -1,11 +1,11 @@
[gd_scene load_steps=11 format=3 uid="uid://bsig1usigbbuy"] [gd_scene load_steps=11 format=3 uid="uid://bsig1usigbbuy"]
[ext_resource type="Texture2D" uid="uid://b3g14elmg0m36" path="res://demo/assets/env_rocks.png" id="1_145kx"] [ext_resource type="Texture2D" uid="uid://b3g14elmg0m36" path="res://demo/assets/env_rocks.png" id="1_145kx"]
[ext_resource type="Texture2D" uid="uid://65b6yuobhxf8" path="res://demo/assets/env_clouds.png" id="1_jm68v"] [ext_resource type="PackedScene" uid="uid://dt2jlrqffpyw" path="res://demo/scenes/clouds.tscn" id="1_gsxmp"]
[ext_resource type="Texture2D" uid="uid://cc7b22sy46gwn" path="res://demo/assets/env_ground.png" id="1_vifjc"] [ext_resource type="Texture2D" uid="uid://cc7b22sy46gwn" path="res://demo/assets/env_ground.png" id="1_vifjc"]
[ext_resource type="Texture2D" uid="uid://4kw2ks8doc0w" path="res://demo/assets/env_plants.png" id="2_kesm7"] [ext_resource type="Texture2D" uid="uid://4kw2ks8doc0w" path="res://demo/assets/env_plants.png" id="2_kesm7"]
[ext_resource type="PackedScene" uid="uid://bpd1wmw2f7bvg" path="res://demo/props/gong.tscn" id="3_nbto3"] [ext_resource type="PackedScene" uid="uid://bpd1wmw2f7bvg" path="res://demo/props/gong.tscn" id="3_nbto3"]
[ext_resource type="PackedScene" uid="uid://ooigbfhfy4wa" path="res://demo/agents/agent_base.tscn" id="5_wgewp"] [ext_resource type="PackedScene" uid="uid://d07ag5dcje13i" path="res://demo/agents/player/player.tscn" id="5_cmgoj"]
[ext_resource type="PackedScene" uid="uid://comfxjrcylgb" path="res://demo/agents/agent_melee_simple.tscn" id="7_ruy6b"] [ext_resource type="PackedScene" uid="uid://comfxjrcylgb" path="res://demo/agents/agent_melee_simple.tscn" id="7_ruy6b"]
[sub_resource type="Animation" id="Animation_gwtgs"] [sub_resource type="Animation" id="Animation_gwtgs"]
@ -2845,258 +2845,7 @@ offset_bottom = 2502.0
color = Color(0.537255, 0.745098, 0.854902, 1) color = Color(0.537255, 0.745098, 0.854902, 1)
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="Clouds" type="Node2D" parent="."] [node name="Clouds" parent="." instance=ExtResource("1_gsxmp")]
modulate = Color(1, 1, 1, 0.792157)
position = Vector2(-1998, -1508)
metadata/_edit_lock_ = true
[node name="Cloud1" type="Sprite2D" parent="Clouds"]
position = Vector2(764, 358)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud13" type="Sprite2D" parent="Clouds"]
position = Vector2(4005, 2983)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud5" type="Sprite2D" parent="Clouds"]
position = Vector2(-152, 2723)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud6" type="Sprite2D" parent="Clouds"]
position = Vector2(3293, 936)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud2" type="Sprite2D" parent="Clouds"]
position = Vector2(85, 1505)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud16" type="Sprite2D" parent="Clouds"]
position = Vector2(3434, 3542)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud7" type="Sprite2D" parent="Clouds"]
position = Vector2(1380, 3802)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud3" type="Sprite2D" parent="Clouds"]
position = Vector2(503, 1222)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud14" type="Sprite2D" parent="Clouds"]
position = Vector2(4174, 3309)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud15" type="Sprite2D" parent="Clouds"]
position = Vector2(4695, 2800)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud8" type="Sprite2D" parent="Clouds"]
position = Vector2(152, 3383)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud4" type="Sprite2D" parent="Clouds"]
position = Vector2(164, 1669)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud9" type="Sprite2D" parent="Clouds"]
position = Vector2(328, 3474)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud10" type="Sprite2D" parent="Clouds"]
position = Vector2(933, 515)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud12" type="Sprite2D" parent="Clouds"]
position = Vector2(4570, 1222)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud11" type="Sprite2D" parent="Clouds"]
position = Vector2(3784, 345)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud17" type="Sprite2D" parent="Clouds"]
position = Vector2(-2737.13, 367.814)
scale = Vector2(1.35085, 1.15254)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud18" type="Sprite2D" parent="Clouds"]
position = Vector2(-1254.92, 3539.61)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud19" type="Sprite2D" parent="Clouds"]
position = Vector2(-2912.7, 1260.29)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud20" type="Sprite2D" parent="Clouds"]
position = Vector2(-3251.5, 3437.56)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud21" type="Sprite2D" parent="Clouds"]
position = Vector2(-3181.26, 3581.44)
scale = Vector2(0.949153, 0.949153)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud22" type="Sprite2D" parent="Clouds"]
position = Vector2(-420.856, 367.017)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud23" type="Sprite2D" parent="Clouds"]
position = Vector2(-1493, 3040)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud24" type="Sprite2D" parent="Clouds"]
position = Vector2(-510, 2429)
scale = Vector2(1.15254, 1.15254)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud25" type="Sprite2D" parent="Clouds"]
position = Vector2(-712, 1373)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud26" type="Sprite2D" parent="Clouds"]
position = Vector2(-269, 2004)
scale = Vector2(0.79661, 0.79661)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud27" type="Sprite2D" parent="Clouds"]
position = Vector2(-1656, 2353)
scale = Vector2(0.949153, 0.949153)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud28" type="Sprite2D" parent="Clouds"]
position = Vector2(-461, 1787)
scale = Vector2(1.10169, 1.10169)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud29" type="Sprite2D" parent="Clouds"]
position = Vector2(3890, 2612.5)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud30" type="Sprite2D" parent="Clouds"]
position = Vector2(3832, 1394.5)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud31" type="Sprite2D" parent="Clouds"]
position = Vector2(3472, 3106)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud32" type="Sprite2D" parent="Clouds"]
position = Vector2(3095, 2689.5)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud33" type="Sprite2D" parent="Clouds"]
position = Vector2(4016, 1558.5)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud34" type="Sprite2D" parent="Clouds"]
position = Vector2(3863, 1375)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(12, 7, 455, 168)
[node name="Cloud35" type="Sprite2D" parent="Clouds"]
position = Vector2(3521.25, 3087)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud36" type="Sprite2D" parent="Clouds"]
position = Vector2(3609.25, 3161)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(507, 7, 193, 88)
[node name="Cloud37" type="Sprite2D" parent="Clouds"]
visible = false
position = Vector2(3754.25, 1447)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(501, 99, 210, 92)
[node name="Cloud38" type="Sprite2D" parent="Clouds"]
visible = false
position = Vector2(2915.25, 2833)
scale = Vector2(0.898305, 0.898305)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Cloud39" type="Sprite2D" parent="Clouds"]
visible = false
position = Vector2(3270.25, 2207)
texture = ExtResource("1_jm68v")
region_enabled = true
region_rect = Rect2(10, 189, 644, 165)
[node name="Ground" type="Node2D" parent="."] [node name="Ground" type="Node2D" parent="."]
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
@ -3123,16 +2872,22 @@ metadata/_edit_lock_ = true
y_sort_enabled = true y_sort_enabled = true
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="Agent" parent="YSort/Agents" instance=ExtResource("5_wgewp")]
position = Vector2(775, 332)
[node name="Camera2D" type="Camera2D" parent="YSort/Agents/Agent"]
position = Vector2(295, -350)
zoom = Vector2(0.88, 0.88)
[node name="AgentMeleeSimple" parent="YSort/Agents" instance=ExtResource("7_ruy6b")] [node name="AgentMeleeSimple" parent="YSort/Agents" instance=ExtResource("7_ruy6b")]
position = Vector2(1212, 333) position = Vector2(1212, 333)
[node name="Player" parent="YSort/Agents" instance=ExtResource("5_cmgoj")]
position = Vector2(633, 256)
[node name="Camera2D" type="Camera2D" parent="YSort/Agents/Player"]
position = Vector2(0, -142)
zoom = Vector2(0.88, 0.88)
process_callback = 0
position_smoothing_enabled = true
drag_horizontal_enabled = true
drag_vertical_enabled = true
drag_top_margin = 0.1
drag_bottom_margin = 0.1
[node name="Props" type="Node2D" parent="YSort"] [node name="Props" type="Node2D" parent="YSort"]
y_sort_enabled = true y_sort_enabled = true
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
@ -5150,3 +4905,10 @@ region_rect = Rect2(996.053, 4.65938, 177.044, 92.8809)
[node name="Gong" parent="YSort/Props" instance=ExtResource("3_nbto3")] [node name="Gong" parent="YSort/Props" instance=ExtResource("3_nbto3")]
position = Vector2(1059, -29) position = Vector2(1059, -29)
[node name="Limits" type="StaticBody2D" parent="."]
metadata/_edit_lock_ = true
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Limits"]
polygon = PackedVector2Array(-814, 535, -380, 190, -306, -21, 87, -46, 346, -330, 870, -373, 1115, -418, 1363, -334, 1613, -324, 1854, -225, 2208, -197, 2675, 309, 2642, 741, 2244, 1140, 1618, 1271, 1360, 1193, 865, 1423, 706, 1377, -113, 1192, -452, 1035, -488, 902, -625, 803, -734, 680, -1660, 719, -1331, 2205, 3170, 2304, 3988, 404, 2999, -1433, 131, -1364, -1715, 264, -1659, 716, -737, 676)
metadata/_edit_lock_ = true

View File

@ -20,6 +20,36 @@ config/icon="res://demo/icon.svg"
window/size/viewport_width=1920 window/size/viewport_width=1920
window/size/viewport_height=1080 window/size/viewport_height=1080
[input]
move_left={
"deadzone": 0.5,
"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":65,"key_label":0,"unicode":97,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"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":68,"key_label":0,"unicode":100,"echo":false,"script":null)
]
}
move_up={
"deadzone": 0.5,
"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":87,"key_label":0,"unicode":119,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"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":83,"key_label":0,"unicode":115,"echo":false,"script":null)
]
}
[layer_names]
2d_physics/layer_1="Obstacle"
2d_physics/layer_2="Player"
2d_physics/layer_3="Hurtbox"
2d_physics/layer_4="Enemy"
[limbo_ai] [limbo_ai]
behavior_tree/behavior_tree_default_dir="res://demo/ai/trees" behavior_tree/behavior_tree_default_dir="res://demo/ai/trees"