init
This commit is contained in:
58
'
Normal file
58
'
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
@tool
|
||||||
|
class_name TreasureChest extends Node2D
|
||||||
|
|
||||||
|
@export var item_data: ItemData :
|
||||||
|
set = set_item_data
|
||||||
|
@export var quantity: int = 1 :
|
||||||
|
set = set_quantity
|
||||||
|
|
||||||
|
@onready var item_sprite: Sprite2D = $ItemSprite
|
||||||
|
@onready var label: Label = $ItemSprite/Label
|
||||||
|
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||||
|
@onready var area: Area2D = $Area2D
|
||||||
|
|
||||||
|
var is_open := false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
update_texture()
|
||||||
|
update_label()
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
return
|
||||||
|
|
||||||
|
area.area_entered.connect(on_area_entered)
|
||||||
|
area.area_exited.connect(on_area_exited)
|
||||||
|
|
||||||
|
func set_item_data(new_item_data: ItemData) -> void:
|
||||||
|
item_data = new_item_data
|
||||||
|
update_texture()
|
||||||
|
|
||||||
|
func set_quantity(new_quantity: int) -> void:
|
||||||
|
quantity = new_quantity
|
||||||
|
update_label()
|
||||||
|
|
||||||
|
func on_area_entered(_body: Area2D) -> void:
|
||||||
|
PlayerManager.interact_pressed.connect(on_player_interaction)
|
||||||
|
|
||||||
|
func on_area_exited(_body: Area2D) -> void:
|
||||||
|
PlayerManager.interact_pressed.disconnect(on_player_interaction)
|
||||||
|
|
||||||
|
func on_player_interaction() -> void:
|
||||||
|
if is_open:
|
||||||
|
return
|
||||||
|
is_open = true
|
||||||
|
animation_player.play("open_chest")
|
||||||
|
if item_data and quantity > 0:
|
||||||
|
PlayerManager.INVENTORY_DATA.add_item(item_data, quantity)
|
||||||
|
else:
|
||||||
|
printerr("Chest has not items")
|
||||||
|
push_error("Chest has not items")
|
||||||
|
|
||||||
|
func update_texture() -> void:
|
||||||
|
if !item_data or !sprite:
|
||||||
|
return
|
||||||
|
sprite.texture = item_data.texture
|
||||||
|
|
||||||
|
func update_label() -> void:
|
||||||
|
if !label:
|
||||||
|
return
|
||||||
|
label.text = "x%d" % quantity if quantity > 0 else ""
|
||||||
4
.editorconfig
Normal file
4
.editorconfig
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
||||||
21
addons/godot-git-plugin/LICENSE
Normal file
21
addons/godot-git-plugin/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2016-2023 The Godot Engine community
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
1346
addons/godot-git-plugin/THIRDPARTY.md
Normal file
1346
addons/godot-git-plugin/THIRDPARTY.md
Normal file
File diff suppressed because it is too large
Load Diff
10
addons/godot-git-plugin/git_plugin.gdextension
Normal file
10
addons/godot-git-plugin/git_plugin.gdextension
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[configuration]
|
||||||
|
|
||||||
|
entry_symbol = "git_plugin_init"
|
||||||
|
compatibility_minimum = "4.2.0"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
|
||||||
|
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
|
||||||
|
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
|
||||||
|
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"
|
||||||
1
addons/godot-git-plugin/git_plugin.gdextension.uid
Normal file
1
addons/godot-git-plugin/git_plugin.gdextension.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c5omy6f07poep
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
enemies/goblin/goblin.png
Normal file
BIN
enemies/goblin/goblin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
40
enemies/goblin/goblin.png.import
Normal file
40
enemies/goblin/goblin.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bvl5x6dfc8nr4"
|
||||||
|
path="res://.godot/imported/goblin.png-143728cb27735b6eb63f3f95b60fd4e9.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://enemies/goblin/goblin.png"
|
||||||
|
dest_files=["res://.godot/imported/goblin.png-143728cb27735b6eb63f3f95b60fd4e9.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
|
||||||
832
enemies/goblin/goblin.tscn
Normal file
832
enemies/goblin/goblin.tscn
Normal file
@@ -0,0 +1,832 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cksw7i4wuuald"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cmfpf1k80hvh7" path="res://enemies/scripts/enemy.gd" id="1_fn8x2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bxqdnnk4dqnu5" path="res://player/sprites/Shadow.png" id="2_gyubk"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bvl5x6dfc8nr4" path="res://enemies/goblin/goblin.png" id="3_a1dmc"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://dcbm4phywpbji" path="res://enemies/slime/hit_01.wav" id="4_tpgwk"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://b0cm6n01nff3w" path="res://enemies/slime/hit_00.wav" id="5_hljvr"]
|
||||||
|
[ext_resource type="Script" uid="uid://bvjx5c5xd3rhw" path="res://enemies/scripts/enemy_state_machine.gd" id="6_v7wfw"]
|
||||||
|
[ext_resource type="Script" uid="uid://t2wl0iif703e" path="res://enemies/scripts/states/enemy_state_idle.gd" id="7_hssmb"]
|
||||||
|
[ext_resource type="Script" uid="uid://dqiqly265lt0u" path="res://enemies/scripts/states/enemy_state_wander.gd" id="8_erdao"]
|
||||||
|
[ext_resource type="Script" uid="uid://b6sf2nm67yulk" path="res://enemies/scripts/states/enemy_state_stun.gd" id="9_adllb"]
|
||||||
|
[ext_resource type="Script" uid="uid://qn1vn11fqgui" path="res://enemies/scripts/states/enemy_state_destroy.gd" id="10_a7klv"]
|
||||||
|
[ext_resource type="Script" uid="uid://cqeos77b55w5x" path="res://enemies/scripts/drop_data.gd" id="11_mr2i6"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bc4mt6ldpoq18" path="res://items/gem.tres" id="12_qfsop"]
|
||||||
|
[ext_resource type="Resource" uid="uid://wif1wqrr83k0" path="res://items/apple.tres" id="13_ksuod"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mwyvk4gke34" path="res://general/hurtbox/hurtbox.tscn" id="14_b2jpe"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cvcxdarfsvvp" path="res://enemies/slime/DestroySmoke.png" id="15_qb7la"]
|
||||||
|
[ext_resource type="Script" uid="uid://dmcmplui6od1k" path="res://enemies/scripts/states/enemy_state_chase.gd" id="16_7cl5y"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cda6fr5vhb4ty" path="res://general/hitbox/hitbox.tscn" id="16_mmp0q"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://4bv0pi2yn5es" path="res://enemies/vision_area.tscn" id="17_2fgol"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_5ctnu"]
|
||||||
|
radius = 13.0
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_klbxu"]
|
||||||
|
radius = 13.0
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_j284o"]
|
||||||
|
radius = 5.0
|
||||||
|
height = 22.0
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_j284o"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("main_sprite/SpearHurtbox:position")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, 14)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_a1dmc"]
|
||||||
|
resource_name = "chase_down"
|
||||||
|
length = 0.6
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [12, 13, 14, 15]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite/SpearHurtbox:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45000002),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [Vector2(0, 11), Vector2(0, 11), Vector2(0, 17), Vector2(0, 11)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_2fgol"]
|
||||||
|
resource_name = "chase_side"
|
||||||
|
length = 0.6
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [20, 21, 22, 23]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite/SpearHurtbox:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45000002),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [Vector2(4, 14), Vector2(2, 14), Vector2(9, 14), Vector2(4, 14)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_7cl5y"]
|
||||||
|
resource_name = "chase_up"
|
||||||
|
length = 0.6
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [16, 17, 18, 19]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite/SpearHurtbox:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45000002),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [Vector2(0, 0), Vector2(0, 0), Vector2(0, -2), Vector2(0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_klbxu"]
|
||||||
|
resource_name = "destroy_down"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020354, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_hljvr")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "animation"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/5/type = "value"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_im24l"]
|
||||||
|
resource_name = "destroy_side"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_hljvr")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "animation"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/5/type = "value"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_mwtj1"]
|
||||||
|
resource_name = "destroy_up"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [4]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_hljvr")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "animation"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/5/type = "value"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6326o"]
|
||||||
|
resource_name = "idle_down"
|
||||||
|
length = 0.4
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_57eei"]
|
||||||
|
resource_name = "idle_side"
|
||||||
|
length = 0.4
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_u2l51"]
|
||||||
|
resource_name = "idle_up"
|
||||||
|
length = 0.4
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [4]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_kag0e"]
|
||||||
|
resource_name = "stun_down"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_knvw0"]
|
||||||
|
resource_name = "stun_side"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_yuirh"]
|
||||||
|
resource_name = "stun_up"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(-2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [4]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("audio")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_tpgwk")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_2ui2u"]
|
||||||
|
resource_name = "walk_down"
|
||||||
|
length = 0.8
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_bkm6f"]
|
||||||
|
resource_name = "walk_side"
|
||||||
|
length = 0.8
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8, 9, 10, 11]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_5ctnu"]
|
||||||
|
resource_name = "walk_up"
|
||||||
|
length = 0.7
|
||||||
|
loop_mode = 1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
|
||||||
|
"transitions": PackedFloat32Array(1, 1.035265, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [4, 5, 6, 7]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kag0e"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_j284o"),
|
||||||
|
&"chase_down": SubResource("Animation_a1dmc"),
|
||||||
|
&"chase_side": SubResource("Animation_2fgol"),
|
||||||
|
&"chase_up": SubResource("Animation_7cl5y"),
|
||||||
|
&"destroy_down": SubResource("Animation_klbxu"),
|
||||||
|
&"destroy_side": SubResource("Animation_im24l"),
|
||||||
|
&"destroy_up": SubResource("Animation_mwtj1"),
|
||||||
|
&"idle_down": SubResource("Animation_6326o"),
|
||||||
|
&"idle_side": SubResource("Animation_57eei"),
|
||||||
|
&"idle_up": SubResource("Animation_u2l51"),
|
||||||
|
&"stun_down": SubResource("Animation_kag0e"),
|
||||||
|
&"stun_side": SubResource("Animation_knvw0"),
|
||||||
|
&"stun_up": SubResource("Animation_yuirh"),
|
||||||
|
&"walk_down": SubResource("Animation_2ui2u"),
|
||||||
|
&"walk_side": SubResource("Animation_bkm6f"),
|
||||||
|
&"walk_up": SubResource("Animation_5ctnu")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_yu3x6"]
|
||||||
|
script = ExtResource("11_mr2i6")
|
||||||
|
item = ExtResource("12_qfsop")
|
||||||
|
max_amount = 4
|
||||||
|
metadata/_custom_type_script = "uid://cqeos77b55w5x"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_okhmd"]
|
||||||
|
script = ExtResource("11_mr2i6")
|
||||||
|
item = ExtResource("13_ksuod")
|
||||||
|
drop_rate = 33.0
|
||||||
|
metadata/_custom_type_script = "uid://cqeos77b55w5x"
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_v3fw7"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_0oddt"]
|
||||||
|
resource_name = "destroy"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.099999994, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.6),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true, false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_klbxu"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_v3fw7"),
|
||||||
|
&"destroy": SubResource("Animation_0oddt")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Goblin" type="CharacterBody2D" unique_id=2039155988]
|
||||||
|
collision_layer = 256
|
||||||
|
collision_mask = 16
|
||||||
|
script = ExtResource("1_fn8x2")
|
||||||
|
|
||||||
|
[node name="Hurtbox" parent="." unique_id=38213362 instance=ExtResource("14_b2jpe")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox" unique_id=378145594]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
shape = SubResource("CircleShape2D_5ctnu")
|
||||||
|
debug_color = Color(0.6581531, 0.51457477, 0.100101404, 0.41960785)
|
||||||
|
|
||||||
|
[node name="Hitbox" parent="." unique_id=1876591880 instance=ExtResource("16_mmp0q")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=708724179]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
shape = SubResource("CircleShape2D_klbxu")
|
||||||
|
debug_color = Color(0.99824387, 0, 0.15809265, 0.41960785)
|
||||||
|
|
||||||
|
[node name="shadow_sprite" type="Sprite2D" parent="." unique_id=41851023]
|
||||||
|
modulate = Color(0.61505616, 0.3702431, 0.12079669, 0.8039216)
|
||||||
|
position = Vector2(0, 2)
|
||||||
|
scale = Vector2(0.75, 0.75)
|
||||||
|
texture = ExtResource("2_gyubk")
|
||||||
|
|
||||||
|
[node name="main_sprite" type="Sprite2D" parent="." unique_id=2116964596]
|
||||||
|
position = Vector2(0, -14)
|
||||||
|
texture = ExtResource("3_a1dmc")
|
||||||
|
hframes = 8
|
||||||
|
vframes = 3
|
||||||
|
|
||||||
|
[node name="SpearHurtbox" parent="main_sprite" unique_id=426932876 instance=ExtResource("14_b2jpe")]
|
||||||
|
position = Vector2(0, 14)
|
||||||
|
monitoring = false
|
||||||
|
damage = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="main_sprite/SpearHurtbox" unique_id=1604105915]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
shape = SubResource("CircleShape2D_5ctnu")
|
||||||
|
debug_color = Color(0.5251133, 0.34901688, 0.016019357, 0.41960785)
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=189927216]
|
||||||
|
rotation = 1.5707964
|
||||||
|
shape = SubResource("CapsuleShape2D_j284o")
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1867521179]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_kag0e")
|
||||||
|
|
||||||
|
[node name="enemy_state_machine" type="Node2D" parent="." unique_id=208543397]
|
||||||
|
script = ExtResource("6_v7wfw")
|
||||||
|
|
||||||
|
[node name="idle" type="Node2D" parent="enemy_state_machine" unique_id=1109025638 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("7_hssmb")
|
||||||
|
next_state = NodePath("../wander")
|
||||||
|
|
||||||
|
[node name="wander" type="Node2D" parent="enemy_state_machine" unique_id=1566208588 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("8_erdao")
|
||||||
|
next_state = NodePath("../idle")
|
||||||
|
|
||||||
|
[node name="stun" type="Node2D" parent="enemy_state_machine" unique_id=1564475499 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("9_adllb")
|
||||||
|
next_state = NodePath("../chase")
|
||||||
|
|
||||||
|
[node name="destroy" type="Node2D" parent="enemy_state_machine" unique_id=569812721]
|
||||||
|
script = ExtResource("10_a7klv")
|
||||||
|
drops = Array[ExtResource("11_mr2i6")]([SubResource("Resource_yu3x6"), SubResource("Resource_okhmd")])
|
||||||
|
|
||||||
|
[node name="chase" type="Node2D" parent="enemy_state_machine" unique_id=287992996 node_paths=PackedStringArray("vision_area", "attack_area", "next_state")]
|
||||||
|
script = ExtResource("16_7cl5y")
|
||||||
|
vision_area = NodePath("../../VisionArea")
|
||||||
|
attack_area = NodePath("../../main_sprite/SpearHurtbox")
|
||||||
|
next_state = NodePath("../idle")
|
||||||
|
|
||||||
|
[node name="audio" type="AudioStreamPlayer2D" parent="." unique_id=1148905292]
|
||||||
|
max_polyphony = 4
|
||||||
|
|
||||||
|
[node name="destroy_effect_sprite" type="Sprite2D" parent="." unique_id=837975864]
|
||||||
|
visible = false
|
||||||
|
position = Vector2(0, -9)
|
||||||
|
texture = ExtResource("15_qb7la")
|
||||||
|
hframes = 6
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="destroy_effect_sprite" unique_id=1538706478]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_klbxu")
|
||||||
|
|
||||||
|
[node name="VisionArea" parent="." unique_id=2078416065 instance=ExtResource("17_2fgol")]
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="VisionArea" unique_id=1816798882]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
polygon = PackedVector2Array(-16, 0, 16, 0, 128, 128, -128, 128)
|
||||||
15
enemies/scripts/drop_data.gd
Normal file
15
enemies/scripts/drop_data.gd
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
class_name DropData extends Resource
|
||||||
|
|
||||||
|
@export
|
||||||
|
var item: ItemData
|
||||||
|
@export_range(0, 100, 1, "suffix:%")
|
||||||
|
var drop_rate: float = 100
|
||||||
|
@export_range(1, 10, 1, "suffix:items")
|
||||||
|
var min_amount := 1
|
||||||
|
@export_range(1, 10, 1, "suffix:items")
|
||||||
|
var max_amount := 1
|
||||||
|
|
||||||
|
func get_drop_count() -> int:
|
||||||
|
if randf_range(0, 100) >= drop_rate:
|
||||||
|
return 0
|
||||||
|
return randi_range(min_amount, max_amount)
|
||||||
1
enemies/scripts/drop_data.gd.uid
Normal file
1
enemies/scripts/drop_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cqeos77b55w5x
|
||||||
67
enemies/scripts/enemy.gd
Normal file
67
enemies/scripts/enemy.gd
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
class_name Enemy extends CharacterBody2D
|
||||||
|
|
||||||
|
const DIR_4 = [
|
||||||
|
Vector2.RIGHT,
|
||||||
|
Vector2.DOWN,
|
||||||
|
Vector2.LEFT,
|
||||||
|
Vector2.UP,
|
||||||
|
]
|
||||||
|
|
||||||
|
signal direction_changed(new_direction: Vector2)
|
||||||
|
signal enemy_damaged(hurtbox: Hurtbox)
|
||||||
|
signal enemy_destroyed(hurtbox: Hurtbox)
|
||||||
|
|
||||||
|
@export var hp: int = 3
|
||||||
|
|
||||||
|
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||||
|
@onready var main_sprite: Sprite2D = $main_sprite
|
||||||
|
@onready var hitbox: Hitbox = $Hitbox
|
||||||
|
@onready var state_machine: EnemyStateMachine = $enemy_state_machine
|
||||||
|
|
||||||
|
var cardinal_direction : Vector2 = Vector2.DOWN
|
||||||
|
var direction : Vector2 = Vector2.ZERO
|
||||||
|
var invulnerable: bool = false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
state_machine.initialize(self)
|
||||||
|
hitbox.damaged.connect(on_damage)
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _physics_process(_delta: float) -> void:
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
func set_direction(new_direction: Vector2) -> bool:
|
||||||
|
if new_direction == Vector2.ZERO:
|
||||||
|
return false
|
||||||
|
|
||||||
|
var refreshed_direction = DIR_4[int(round((new_direction + cardinal_direction * 0.1).angle() / TAU * DIR_4.size()))]
|
||||||
|
|
||||||
|
if refreshed_direction == cardinal_direction:
|
||||||
|
return false
|
||||||
|
cardinal_direction = refreshed_direction
|
||||||
|
direction_changed.emit(refreshed_direction)
|
||||||
|
main_sprite.scale.x = -1 if cardinal_direction == Vector2.LEFT else 1
|
||||||
|
return true
|
||||||
|
|
||||||
|
func update_animation(state: String) -> void:
|
||||||
|
animation_player.play(state + "_" + get_animation_direction())
|
||||||
|
|
||||||
|
func get_animation_direction() -> String:
|
||||||
|
var newAnimDirection: String = "side"
|
||||||
|
if cardinal_direction == Vector2.DOWN:
|
||||||
|
newAnimDirection = "down"
|
||||||
|
elif cardinal_direction == Vector2.UP:
|
||||||
|
newAnimDirection = "up"
|
||||||
|
return newAnimDirection
|
||||||
|
|
||||||
|
func on_damage(hurtbox: Hurtbox) -> void:
|
||||||
|
if invulnerable:
|
||||||
|
return
|
||||||
|
hp -= hurtbox.damage
|
||||||
|
if hp > 0:
|
||||||
|
enemy_damaged.emit(hurtbox)
|
||||||
|
else:
|
||||||
|
enemy_destroyed.emit(hurtbox)
|
||||||
|
|
||||||
1
enemies/scripts/enemy.gd.uid
Normal file
1
enemies/scripts/enemy.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cmfpf1k80hvh7
|
||||||
40
enemies/scripts/enemy_state_machine.gd
Normal file
40
enemies/scripts/enemy_state_machine.gd
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
class_name EnemyStateMachine extends Node
|
||||||
|
|
||||||
|
var states: Array[EnemyState]
|
||||||
|
var previous_state: EnemyState
|
||||||
|
var current_state: EnemyState
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
process_mode = Node.PROCESS_MODE_DISABLED
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
change_state(current_state.process(delta))
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
change_state(current_state.physics(delta))
|
||||||
|
|
||||||
|
func initialize(enemy: Enemy) -> void:
|
||||||
|
states = []
|
||||||
|
for child in get_children():
|
||||||
|
if child is EnemyState:
|
||||||
|
states.append(child)
|
||||||
|
|
||||||
|
for state in states:
|
||||||
|
state.enemy = enemy
|
||||||
|
state.state_machine = self
|
||||||
|
state.init()
|
||||||
|
|
||||||
|
if !states.is_empty():
|
||||||
|
change_state(states[0])
|
||||||
|
process_mode = Node.PROCESS_MODE_INHERIT
|
||||||
|
|
||||||
|
func change_state(new_state: EnemyState) -> void:
|
||||||
|
if new_state == null or new_state == current_state:
|
||||||
|
return
|
||||||
|
|
||||||
|
if current_state:
|
||||||
|
current_state.exit()
|
||||||
|
|
||||||
|
previous_state = current_state
|
||||||
|
current_state = new_state
|
||||||
|
current_state.enter()
|
||||||
1
enemies/scripts/enemy_state_machine.gd.uid
Normal file
1
enemies/scripts/enemy_state_machine.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bvjx5c5xd3rhw
|
||||||
20
enemies/scripts/states/enemy_state.gd
Normal file
20
enemies/scripts/states/enemy_state.gd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
class_name EnemyState extends Node
|
||||||
|
|
||||||
|
var enemy: Enemy
|
||||||
|
var state_machine: EnemyStateMachine
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func process(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
1
enemies/scripts/states/enemy_state.gd.uid
Normal file
1
enemies/scripts/states/enemy_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://u7qy2i6rutqr
|
||||||
58
enemies/scripts/states/enemy_state_chase.gd
Normal file
58
enemies/scripts/states/enemy_state_chase.gd
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
class_name EnemyChaseWander extends EnemyState
|
||||||
|
|
||||||
|
@export var animation_name: String = "chase"
|
||||||
|
@export var chase_speed: float = 20.0
|
||||||
|
@export var turn_rate: float = 0.25
|
||||||
|
|
||||||
|
@export_category("AI")
|
||||||
|
@export var vision_area: VisionArea
|
||||||
|
@export var attack_area: Hurtbox
|
||||||
|
@export var state_aggro_duration: float = 0.5
|
||||||
|
@export var next_state: EnemyState
|
||||||
|
|
||||||
|
var timer: float = 0.0
|
||||||
|
var direction: Vector2
|
||||||
|
var can_see_player := false
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
if vision_area:
|
||||||
|
vision_area.player_entered.connect(on_player_entered)
|
||||||
|
vision_area.player_exited.connect(on_player_exited)
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
timer = state_aggro_duration
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
if attack_area:
|
||||||
|
attack_area.monitoring = true
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
if attack_area:
|
||||||
|
attack_area.monitoring = true
|
||||||
|
can_see_player = false
|
||||||
|
|
||||||
|
func process(delta : float) -> EnemyState:
|
||||||
|
var new_dir: Vector2 = enemy.global_position.direction_to(PlayerManager.player.global_position)
|
||||||
|
direction = lerp(direction, new_dir, turn_rate)
|
||||||
|
enemy.velocity = direction * chase_speed
|
||||||
|
if enemy.set_direction(direction):
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
if !can_see_player:
|
||||||
|
timer -= delta
|
||||||
|
if timer <= 0:
|
||||||
|
return next_state
|
||||||
|
else:
|
||||||
|
timer = state_aggro_duration
|
||||||
|
return null
|
||||||
|
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
|
func on_player_entered() -> void:
|
||||||
|
can_see_player = true
|
||||||
|
if state_machine.current_state is EnemyStateStun:
|
||||||
|
return
|
||||||
|
state_machine.change_state(self)
|
||||||
|
|
||||||
|
func on_player_exited() -> void:
|
||||||
|
can_see_player = false
|
||||||
1
enemies/scripts/states/enemy_state_chase.gd.uid
Normal file
1
enemies/scripts/states/enemy_state_chase.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dmcmplui6od1k
|
||||||
64
enemies/scripts/states/enemy_state_destroy.gd
Normal file
64
enemies/scripts/states/enemy_state_destroy.gd
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
class_name EnemyStateDestroy extends EnemyState
|
||||||
|
|
||||||
|
const PICKUP: Resource = preload("res://items/item_pickup/item_pickup.tscn")
|
||||||
|
|
||||||
|
@export var animation_name: String = "destroy"
|
||||||
|
@export var knockback_speed: float = 200.0
|
||||||
|
@export var decelerate_speed: float = 10.0
|
||||||
|
@export_category("Item drops")
|
||||||
|
@export var drops: Array[DropData]
|
||||||
|
|
||||||
|
var direction: Vector2
|
||||||
|
var damage_position: Vector2
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
enemy.enemy_destroyed.connect(on_destroyed)
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
enemy.invulnerable = true
|
||||||
|
enemy.animation_player.animation_finished.connect(on_animation_finished)
|
||||||
|
direction = enemy.global_position.direction_to(damage_position)
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
enemy.set_direction(direction)
|
||||||
|
enemy.velocity = direction * -knockback_speed
|
||||||
|
disable_hurtbox()
|
||||||
|
drop_items()
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
enemy.invulnerable = false
|
||||||
|
enemy.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||||
|
|
||||||
|
func process(delta : float) -> EnemyState:
|
||||||
|
enemy.velocity -= enemy.velocity * decelerate_speed * delta
|
||||||
|
return null
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
|
func on_destroyed(hurtbox: Hurtbox) -> void:
|
||||||
|
state_machine.change_state(self)
|
||||||
|
damage_position = hurtbox.global_position
|
||||||
|
|
||||||
|
func on_animation_finished(_name: String) -> void:
|
||||||
|
print("destroyed")
|
||||||
|
enemy.queue_free()
|
||||||
|
|
||||||
|
func disable_hurtbox() -> void:
|
||||||
|
var hurtbox: Hurtbox = enemy.get_node_or_null("Hurtbox")
|
||||||
|
if hurtbox:
|
||||||
|
hurtbox.monitoring = false
|
||||||
|
|
||||||
|
func drop_items() -> void:
|
||||||
|
if drops.is_empty():
|
||||||
|
return
|
||||||
|
for drops_index in drops.size():
|
||||||
|
var drop_item := drops[drops_index]
|
||||||
|
if drop_item and drop_item.item:
|
||||||
|
var drop_count := drop_item.get_drop_count()
|
||||||
|
for drop_index in drop_count:
|
||||||
|
var item_pickup := PICKUP.instantiate() as ItemPickup
|
||||||
|
item_pickup.item_data = drop_item.item
|
||||||
|
enemy.get_parent().call_deferred("add_child", item_pickup)
|
||||||
|
item_pickup.global_position = enemy.global_position
|
||||||
|
item_pickup.velocity = enemy.velocity.rotated(randf_range(-1.5, 1.5)) * randf_range(0.9, 1.5)
|
||||||
1
enemies/scripts/states/enemy_state_destroy.gd.uid
Normal file
1
enemies/scripts/states/enemy_state_destroy.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://qn1vn11fqgui
|
||||||
30
enemies/scripts/states/enemy_state_idle.gd
Normal file
30
enemies/scripts/states/enemy_state_idle.gd
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
class_name EnemyStateIdle extends EnemyState
|
||||||
|
|
||||||
|
@export var animation_name: String = "idle"
|
||||||
|
|
||||||
|
@export_category("AI")
|
||||||
|
@export var state_duration_min: float = 0.5
|
||||||
|
@export var state_duration_max: float = 1.5
|
||||||
|
@export var next_state: EnemyState
|
||||||
|
|
||||||
|
var timer: float = 0.0
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
enemy.velocity = Vector2.ZERO
|
||||||
|
timer = randf_range(state_duration_min, state_duration_max)
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func process(delta : float) -> EnemyState:
|
||||||
|
timer -= delta
|
||||||
|
if timer <= 0:
|
||||||
|
return next_state
|
||||||
|
return null
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
1
enemies/scripts/states/enemy_state_idle.gd.uid
Normal file
1
enemies/scripts/states/enemy_state_idle.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://t2wl0iif703e
|
||||||
44
enemies/scripts/states/enemy_state_stun.gd
Normal file
44
enemies/scripts/states/enemy_state_stun.gd
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
class_name EnemyStateStun extends EnemyState
|
||||||
|
|
||||||
|
@export var animation_name: String = "stun"
|
||||||
|
@export var knockback_speed: float = 200.0
|
||||||
|
@export var decelerate_speed: float = 10.0
|
||||||
|
|
||||||
|
@export_category("AI")
|
||||||
|
@export var next_state: EnemyState
|
||||||
|
|
||||||
|
var direction: Vector2
|
||||||
|
var damage_position: Vector2
|
||||||
|
var animation_finished: bool = false
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
enemy.enemy_damaged.connect(on_damaged)
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
enemy.animation_player.animation_finished.connect(on_animation_finished)
|
||||||
|
enemy.invulnerable = true
|
||||||
|
animation_finished = false
|
||||||
|
direction = enemy.global_position.direction_to(damage_position)
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
enemy.set_direction(direction)
|
||||||
|
enemy.velocity = direction * -knockback_speed
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
enemy.invulnerable = false
|
||||||
|
enemy.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||||
|
|
||||||
|
func process(delta : float) -> EnemyState:
|
||||||
|
if animation_finished:
|
||||||
|
return next_state
|
||||||
|
enemy.velocity -= enemy.velocity * decelerate_speed * delta
|
||||||
|
return null
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
|
func on_damaged(hurtbox: Hurtbox) -> void:
|
||||||
|
damage_position = hurtbox.global_position
|
||||||
|
state_machine.change_state(self)
|
||||||
|
|
||||||
|
func on_animation_finished(_name: String) -> void:
|
||||||
|
animation_finished = true
|
||||||
1
enemies/scripts/states/enemy_state_stun.gd.uid
Normal file
1
enemies/scripts/states/enemy_state_stun.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b6sf2nm67yulk
|
||||||
38
enemies/scripts/states/enemy_state_wander.gd
Normal file
38
enemies/scripts/states/enemy_state_wander.gd
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
class_name EnemyStateWander extends EnemyState
|
||||||
|
|
||||||
|
@export var animation_name: String = "walk"
|
||||||
|
@export var wander_speed: float = 20.0
|
||||||
|
|
||||||
|
@export_category("AI")
|
||||||
|
@export var state_animation_duration: float = 0.7
|
||||||
|
@export var state_cycles_min: int = 1
|
||||||
|
@export var state_cycles_max: int = 3
|
||||||
|
@export var next_state: EnemyState
|
||||||
|
|
||||||
|
var timer: float = 0.0
|
||||||
|
var direction: Vector2
|
||||||
|
|
||||||
|
func init() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
timer = randi_range(state_cycles_min, state_cycles_max) * state_animation_duration
|
||||||
|
var random_direction = randi_range(0, 3)
|
||||||
|
direction = enemy.DIR_4[random_direction]
|
||||||
|
enemy.velocity = direction * wander_speed
|
||||||
|
enemy.set_direction(direction)
|
||||||
|
enemy.update_animation(animation_name)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func process(delta : float) -> EnemyState:
|
||||||
|
timer -= delta
|
||||||
|
if timer <= 0:
|
||||||
|
return next_state
|
||||||
|
return null
|
||||||
|
|
||||||
|
|
||||||
|
func physics(_delta : float) -> EnemyState:
|
||||||
|
return null
|
||||||
|
|
||||||
1
enemies/scripts/states/enemy_state_wander.gd.uid
Normal file
1
enemies/scripts/states/enemy_state_wander.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dqiqly265lt0u
|
||||||
33
enemies/scripts/vision_area.gd
Normal file
33
enemies/scripts/vision_area.gd
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
class_name VisionArea extends Area2D
|
||||||
|
|
||||||
|
signal player_entered
|
||||||
|
signal player_exited
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
body_entered.connect(on_body_entered)
|
||||||
|
body_exited.connect(on_body_exited)
|
||||||
|
var parent = get_parent()
|
||||||
|
if parent is Enemy:
|
||||||
|
parent.direction_changed.connect(on_direction_changed)
|
||||||
|
|
||||||
|
func on_body_entered(body: Node2D) -> void:
|
||||||
|
if body is Player:
|
||||||
|
player_entered.emit()
|
||||||
|
|
||||||
|
func on_body_exited(body: Node2D) -> void:
|
||||||
|
if body is Player:
|
||||||
|
player_exited.emit()
|
||||||
|
|
||||||
|
func on_direction_changed(new_direction: Vector2) -> void:
|
||||||
|
match new_direction:
|
||||||
|
Vector2.DOWN:
|
||||||
|
rotation_degrees = 0
|
||||||
|
Vector2.UP:
|
||||||
|
rotation_degrees = 180
|
||||||
|
Vector2.LEFT:
|
||||||
|
rotation_degrees = 90
|
||||||
|
Vector2.RIGHT:
|
||||||
|
rotation_degrees = -90
|
||||||
|
_:
|
||||||
|
rotation_degrees = 0
|
||||||
|
|
||||||
1
enemies/scripts/vision_area.gd.uid
Normal file
1
enemies/scripts/vision_area.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dumobb6c7eybb
|
||||||
BIN
enemies/slime/DestroySmoke.png
Normal file
BIN
enemies/slime/DestroySmoke.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
40
enemies/slime/DestroySmoke.png.import
Normal file
40
enemies/slime/DestroySmoke.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cvcxdarfsvvp"
|
||||||
|
path="res://.godot/imported/DestroySmoke.png-3d9ca38dff7bb76c066af857f8439d71.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://enemies/slime/DestroySmoke.png"
|
||||||
|
dest_files=["res://.godot/imported/DestroySmoke.png-3d9ca38dff7bb76c066af857f8439d71.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
enemies/slime/Slime.png
Normal file
BIN
enemies/slime/Slime.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
40
enemies/slime/Slime.png.import
Normal file
40
enemies/slime/Slime.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://0cktmx7bdi6"
|
||||||
|
path="res://.godot/imported/Slime.png-2c32aef4516f36b26731b93e78638e8f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://enemies/slime/Slime.png"
|
||||||
|
dest_files=["res://.godot/imported/Slime.png-2c32aef4516f36b26731b93e78638e8f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
enemies/slime/hit_00.wav
Normal file
BIN
enemies/slime/hit_00.wav
Normal file
Binary file not shown.
24
enemies/slime/hit_00.wav.import
Normal file
24
enemies/slime/hit_00.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://b0cm6n01nff3w"
|
||||||
|
path="res://.godot/imported/hit_00.wav-7d3408cea68163c28d377ef9ea817108.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://enemies/slime/hit_00.wav"
|
||||||
|
dest_files=["res://.godot/imported/hit_00.wav-7d3408cea68163c28d377ef9ea817108.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
BIN
enemies/slime/hit_01.wav
Normal file
BIN
enemies/slime/hit_01.wav
Normal file
Binary file not shown.
24
enemies/slime/hit_01.wav.import
Normal file
24
enemies/slime/hit_01.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://dcbm4phywpbji"
|
||||||
|
path="res://.godot/imported/hit_01.wav-5741b8fa9d470a638cb59f9b3641df34.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://enemies/slime/hit_01.wav"
|
||||||
|
dest_files=["res://.godot/imported/hit_01.wav-5741b8fa9d470a638cb59f9b3641df34.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
859
enemies/slime/slime.tscn
Normal file
859
enemies/slime/slime.tscn
Normal file
@@ -0,0 +1,859 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dv2hjei167q68"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cmfpf1k80hvh7" path="res://enemies/scripts/enemy.gd" id="1_6326o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bxqdnnk4dqnu5" path="res://player/sprites/Shadow.png" id="1_j284o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://0cktmx7bdi6" path="res://enemies/slime/Slime.png" id="2_6326o"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://dcbm4phywpbji" path="res://enemies/slime/hit_01.wav" id="4_5ctnu"]
|
||||||
|
[ext_resource type="Script" uid="uid://bvjx5c5xd3rhw" path="res://enemies/scripts/enemy_state_machine.gd" id="4_57eei"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://b0cm6n01nff3w" path="res://enemies/slime/hit_00.wav" id="5_knvw0"]
|
||||||
|
[ext_resource type="Script" uid="uid://t2wl0iif703e" path="res://enemies/scripts/states/enemy_state_idle.gd" id="5_u2l51"]
|
||||||
|
[ext_resource type="Script" uid="uid://dqiqly265lt0u" path="res://enemies/scripts/states/enemy_state_wander.gd" id="6_2ui2u"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mwyvk4gke34" path="res://general/hurtbox/hurtbox.tscn" id="7_bkm6f"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cvcxdarfsvvp" path="res://enemies/slime/DestroySmoke.png" id="9_kag0e"]
|
||||||
|
[ext_resource type="Script" uid="uid://b6sf2nm67yulk" path="res://enemies/scripts/states/enemy_state_stun.gd" id="9_v3fw7"]
|
||||||
|
[ext_resource type="Script" uid="uid://qn1vn11fqgui" path="res://enemies/scripts/states/enemy_state_destroy.gd" id="10_0oddt"]
|
||||||
|
[ext_resource type="Script" uid="uid://cqeos77b55w5x" path="res://enemies/scripts/drop_data.gd" id="11_mwtj1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cda6fr5vhb4ty" path="res://general/hitbox/hitbox.tscn" id="12_0oddt"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bc4mt6ldpoq18" path="res://items/gem.tres" id="12_im24l"]
|
||||||
|
[ext_resource type="Resource" uid="uid://wif1wqrr83k0" path="res://items/apple.tres" id="13_im24l"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_j284o"]
|
||||||
|
radius = 5.0
|
||||||
|
height = 22.0
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_j284o"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_klbxu"]
|
||||||
|
resource_name = "destroy_down"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [18, 19, 20, 11, 9, 18]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020354, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "audio"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("audio")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_knvw0")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/4/use_blend = true
|
||||||
|
tracks/5/type = "animation"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/6/type = "value"
|
||||||
|
tracks/6/imported = false
|
||||||
|
tracks/6/enabled = true
|
||||||
|
tracks/6/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/6/interp = 1
|
||||||
|
tracks/6/loop_wrap = true
|
||||||
|
tracks/6/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_im24l"]
|
||||||
|
resource_name = "destroy_side"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [24, 25, 26, 17, 15, 24]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "audio"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("audio")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_knvw0")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/4/use_blend = true
|
||||||
|
tracks/5/type = "animation"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/6/type = "value"
|
||||||
|
tracks/6/imported = false
|
||||||
|
tracks/6/enabled = true
|
||||||
|
tracks/6/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/6/interp = 1
|
||||||
|
tracks/6/loop_wrap = true
|
||||||
|
tracks/6/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_mwtj1"]
|
||||||
|
resource_name = "destroy_up"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [21, 22, 23, 14, 12, 21]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1), Color(0.91764706, 0.07058824, 0, 0)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
tracks/4/type = "audio"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("audio")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("5_knvw0")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0.05)
|
||||||
|
}
|
||||||
|
tracks/4/use_blend = true
|
||||||
|
tracks/5/type = "animation"
|
||||||
|
tracks/5/imported = false
|
||||||
|
tracks/5/enabled = true
|
||||||
|
tracks/5/path = NodePath("destroy_effect_sprite/AnimationPlayer")
|
||||||
|
tracks/5/interp = 1
|
||||||
|
tracks/5/loop_wrap = true
|
||||||
|
tracks/5/keys = {
|
||||||
|
"clips": PackedStringArray("destroy"),
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/6/type = "value"
|
||||||
|
tracks/6/imported = false
|
||||||
|
tracks/6/enabled = true
|
||||||
|
tracks/6/path = NodePath("shadow_sprite:modulate")
|
||||||
|
tracks/6/interp = 1
|
||||||
|
tracks/6/loop_wrap = true
|
||||||
|
tracks/6/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.35),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.61505616, 0.3702431, 0.12079669, 0.8039216), Color(0.6156863, 0.36862746, 0.12156863, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6326o"]
|
||||||
|
resource_name = "idle_down"
|
||||||
|
length = 0.4
|
||||||
|
loop_mode = 2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_57eei"]
|
||||||
|
resource_name = "idle_side"
|
||||||
|
length = 0.4
|
||||||
|
loop_mode = 2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6, 7, 8]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_u2l51"]
|
||||||
|
resource_name = "idle_up"
|
||||||
|
length = 0.4
|
||||||
|
loop_mode = 2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [3, 4, 5]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_kag0e"]
|
||||||
|
resource_name = "stun_down"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [18, 19, 20, 11, 9, 18]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_knvw0"]
|
||||||
|
resource_name = "stun_side"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [24, 25, 26, 17, 15, 24]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_yuirh"]
|
||||||
|
resource_name = "stun_up"
|
||||||
|
length = 0.3
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.049999997, 0.099999994, 0.15, 0.2, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2, -2, -2),
|
||||||
|
"update": 1,
|
||||||
|
"values": [21, 22, 23, 14, 12, 21]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.25),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -22), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("main_sprite:modulate")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0.9182674, 0.07020355, 0, 1), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
tracks/3/type = "audio"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("audio")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("4_5ctnu")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/3/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_2ui2u"]
|
||||||
|
resource_name = "walk_down"
|
||||||
|
length = 0.7
|
||||||
|
loop_mode = 1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [9, 10, 11, 9]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.5, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -19), Vector2(0, -23), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_bkm6f"]
|
||||||
|
resource_name = "walk_side"
|
||||||
|
length = 0.7
|
||||||
|
loop_mode = 1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [15, 16, 17, 15]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.5, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -19), Vector2(0, -23), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_5ctnu"]
|
||||||
|
resource_name = "walk_up"
|
||||||
|
length = 0.7
|
||||||
|
loop_mode = 1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("main_sprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [12, 13, 14, 12]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("main_sprite:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2, 0.5, 0.6666667),
|
||||||
|
"transitions": PackedFloat32Array(-2, -2, -2, -2),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, -19), Vector2(0, -19), Vector2(0, -23), Vector2(0, -19)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kag0e"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_j284o"),
|
||||||
|
&"destroy_down": SubResource("Animation_klbxu"),
|
||||||
|
&"destroy_side": SubResource("Animation_im24l"),
|
||||||
|
&"destroy_up": SubResource("Animation_mwtj1"),
|
||||||
|
&"idle_down": SubResource("Animation_6326o"),
|
||||||
|
&"idle_side": SubResource("Animation_57eei"),
|
||||||
|
&"idle_up": SubResource("Animation_u2l51"),
|
||||||
|
&"stun_down": SubResource("Animation_kag0e"),
|
||||||
|
&"stun_side": SubResource("Animation_knvw0"),
|
||||||
|
&"stun_up": SubResource("Animation_yuirh"),
|
||||||
|
&"walk_down": SubResource("Animation_2ui2u"),
|
||||||
|
&"walk_side": SubResource("Animation_bkm6f"),
|
||||||
|
&"walk_up": SubResource("Animation_5ctnu")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_yu3x6"]
|
||||||
|
script = ExtResource("11_mwtj1")
|
||||||
|
item = ExtResource("12_im24l")
|
||||||
|
max_amount = 4
|
||||||
|
metadata/_custom_type_script = "uid://cqeos77b55w5x"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_okhmd"]
|
||||||
|
script = ExtResource("11_mwtj1")
|
||||||
|
item = ExtResource("13_im24l")
|
||||||
|
drop_rate = 33.0
|
||||||
|
metadata/_custom_type_script = "uid://cqeos77b55w5x"
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_5ctnu"]
|
||||||
|
radius = 13.0
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_v3fw7"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_0oddt"]
|
||||||
|
resource_name = "destroy"
|
||||||
|
length = 0.6
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.099999994, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.6),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true, false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_klbxu"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_v3fw7"),
|
||||||
|
&"destroy": SubResource("Animation_0oddt")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_klbxu"]
|
||||||
|
radius = 13.0
|
||||||
|
|
||||||
|
[node name="Slime" type="CharacterBody2D" unique_id=2039155988]
|
||||||
|
collision_layer = 256
|
||||||
|
collision_mask = 16
|
||||||
|
script = ExtResource("1_6326o")
|
||||||
|
|
||||||
|
[node name="shadow_sprite" type="Sprite2D" parent="." unique_id=41851023]
|
||||||
|
modulate = Color(0.61505616, 0.3702431, 0.12079669, 0.8039216)
|
||||||
|
position = Vector2(0, 2)
|
||||||
|
texture = ExtResource("1_j284o")
|
||||||
|
|
||||||
|
[node name="main_sprite" type="Sprite2D" parent="." unique_id=2116964596]
|
||||||
|
position = Vector2(0, -19)
|
||||||
|
texture = ExtResource("2_6326o")
|
||||||
|
hframes = 16
|
||||||
|
vframes = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=189927216]
|
||||||
|
rotation = 1.5707964
|
||||||
|
shape = SubResource("CapsuleShape2D_j284o")
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1867521179]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_kag0e")
|
||||||
|
|
||||||
|
[node name="enemy_state_machine" type="Node2D" parent="." unique_id=208543397]
|
||||||
|
script = ExtResource("4_57eei")
|
||||||
|
|
||||||
|
[node name="idle" type="Node2D" parent="enemy_state_machine" unique_id=1109025638 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("5_u2l51")
|
||||||
|
next_state = NodePath("../wander")
|
||||||
|
|
||||||
|
[node name="wander" type="Node2D" parent="enemy_state_machine" unique_id=1566208588 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("6_2ui2u")
|
||||||
|
next_state = NodePath("../idle")
|
||||||
|
|
||||||
|
[node name="stun" type="Node2D" parent="enemy_state_machine" unique_id=1564475499 node_paths=PackedStringArray("next_state")]
|
||||||
|
script = ExtResource("9_v3fw7")
|
||||||
|
next_state = NodePath("../idle")
|
||||||
|
|
||||||
|
[node name="destroy" type="Node2D" parent="enemy_state_machine" unique_id=569812721]
|
||||||
|
script = ExtResource("10_0oddt")
|
||||||
|
drops = Array[ExtResource("11_mwtj1")]([SubResource("Resource_yu3x6"), SubResource("Resource_okhmd")])
|
||||||
|
|
||||||
|
[node name="Hurtbox" parent="." unique_id=38213362 instance=ExtResource("7_bkm6f")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox" unique_id=378145594]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
shape = SubResource("CircleShape2D_5ctnu")
|
||||||
|
debug_color = Color(0.6581531, 0.51457477, 0.100101404, 0.41960785)
|
||||||
|
|
||||||
|
[node name="audio" type="AudioStreamPlayer2D" parent="." unique_id=1148905292]
|
||||||
|
max_polyphony = 4
|
||||||
|
|
||||||
|
[node name="destroy_effect_sprite" type="Sprite2D" parent="." unique_id=837975864]
|
||||||
|
visible = false
|
||||||
|
position = Vector2(0, -9)
|
||||||
|
texture = ExtResource("9_kag0e")
|
||||||
|
hframes = 6
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="destroy_effect_sprite" unique_id=1538706478]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_klbxu")
|
||||||
|
|
||||||
|
[node name="Hitbox" parent="." unique_id=1876591880 instance=ExtResource("12_0oddt")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=708724179]
|
||||||
|
position = Vector2(0, -7)
|
||||||
|
shape = SubResource("CircleShape2D_klbxu")
|
||||||
|
debug_color = Color(0.84817815, 0.37813845, 0, 0.41960785)
|
||||||
8
enemies/vision_area.tscn
Normal file
8
enemies/vision_area.tscn
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene format=3 uid="uid://4bv0pi2yn5es"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dumobb6c7eybb" path="res://enemies/scripts/vision_area.gd" id="1_t1srl"]
|
||||||
|
|
||||||
|
[node name="VisionArea" type="Area2D" unique_id=2078416065]
|
||||||
|
collision_layer = 0
|
||||||
|
monitorable = false
|
||||||
|
script = ExtResource("1_t1srl")
|
||||||
20
general/enemy_counter/enemy_counter.gd
Normal file
20
general/enemy_counter/enemy_counter.gd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
class_name EnemyCounter extends Node2D
|
||||||
|
|
||||||
|
signal enemies_defeated
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
child_exiting_tree.connect(on_enemy_destroyed)
|
||||||
|
pass
|
||||||
|
|
||||||
|
func on_enemy_destroyed(node: Node2D) -> void:
|
||||||
|
if node is Enemy and enemy_count() <= 1:
|
||||||
|
enemies_defeated.emit()
|
||||||
|
print("ENEMIES DEFEATED")
|
||||||
|
|
||||||
|
func enemy_count() -> int:
|
||||||
|
var count := 0
|
||||||
|
for child in get_children():
|
||||||
|
if child is Enemy:
|
||||||
|
count += 1
|
||||||
|
return count
|
||||||
|
|
||||||
1
general/enemy_counter/enemy_counter.gd.uid
Normal file
1
general/enemy_counter/enemy_counter.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bxyv7orhs7xw2
|
||||||
6
general/enemy_counter/enemy_counter.tscn
Normal file
6
general/enemy_counter/enemy_counter.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene format=3 uid="uid://s54xni3yvek5"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bxyv7orhs7xw2" path="res://general/enemy_counter/enemy_counter.gd" id="1_6ymjw"]
|
||||||
|
|
||||||
|
[node name="EnemyCounter" type="Node2D" unique_id=1225445185]
|
||||||
|
script = ExtResource("1_6ymjw")
|
||||||
13
general/hitbox/hitbox.gd
Normal file
13
general/hitbox/hitbox.gd
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class_name Hitbox extends Area2D
|
||||||
|
|
||||||
|
signal damaged(hurtbox: Hurtbox)
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func take_damage(hurtbox: Hurtbox) -> void:
|
||||||
|
damaged.emit(hurtbox)
|
||||||
1
general/hitbox/hitbox.gd.uid
Normal file
1
general/hitbox/hitbox.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cmdjqh873unve
|
||||||
9
general/hitbox/hitbox.tscn
Normal file
9
general/hitbox/hitbox.tscn
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cda6fr5vhb4ty"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cmdjqh873unve" path="res://general/hitbox/hitbox.gd" id="1_4tnmp"]
|
||||||
|
|
||||||
|
[node name="Hitbox" type="Area2D" unique_id=1876591880]
|
||||||
|
collision_layer = 256
|
||||||
|
collision_mask = 0
|
||||||
|
monitoring = false
|
||||||
|
script = ExtResource("1_4tnmp")
|
||||||
13
general/hurtbox/hurtbox.gd
Normal file
13
general/hurtbox/hurtbox.gd
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class_name Hurtbox extends Area2D
|
||||||
|
|
||||||
|
@export var damage: int = 1
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
area_entered.connect(hurtbox_entered)
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func hurtbox_entered(area: Area2D) -> void:
|
||||||
|
if area is Hitbox:
|
||||||
|
area.take_damage(self)
|
||||||
1
general/hurtbox/hurtbox.gd.uid
Normal file
1
general/hurtbox/hurtbox.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c0fmav64y2rrk
|
||||||
9
general/hurtbox/hurtbox.tscn
Normal file
9
general/hurtbox/hurtbox.tscn
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_scene format=3 uid="uid://mwyvk4gke34"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c0fmav64y2rrk" path="res://general/hurtbox/hurtbox.gd" id="1_85hd5"]
|
||||||
|
|
||||||
|
[node name="Hurtbox" type="Area2D" unique_id=38213362]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
monitorable = false
|
||||||
|
script = ExtResource("1_85hd5")
|
||||||
BIN
general/item-dropper/dungeon_discovery.wav
Normal file
BIN
general/item-dropper/dungeon_discovery.wav
Normal file
Binary file not shown.
24
general/item-dropper/dungeon_discovery.wav.import
Normal file
24
general/item-dropper/dungeon_discovery.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://b7nup12qxtlh"
|
||||||
|
path="res://.godot/imported/dungeon_discovery.wav-41484ca4e230435a886c5306ceaade95.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://general/item-dropper/dungeon_discovery.wav"
|
||||||
|
dest_files=["res://.godot/imported/dungeon_discovery.wav-41484ca4e230435a886c5306ceaade95.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
46
general/item-dropper/item_dropper.gd
Normal file
46
general/item-dropper/item_dropper.gd
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
@tool
|
||||||
|
class_name ItemDropper extends Node2D
|
||||||
|
|
||||||
|
const PICKUP = preload("res://items/item_pickup/item_pickup.tscn")
|
||||||
|
|
||||||
|
@export var item: ItemData : set = set_item_data
|
||||||
|
|
||||||
|
@onready var sprite: Sprite2D = $Sprite2D
|
||||||
|
@onready var dropped_data: PersistentDataHandler = $PersistentDataHandler
|
||||||
|
@onready var audio: AudioStreamPlayer = $AudioStreamPlayer
|
||||||
|
|
||||||
|
var dropped := false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
update_texture()
|
||||||
|
return
|
||||||
|
sprite.visible = false
|
||||||
|
dropped_data.data_loaded.connect(on_data_loaded)
|
||||||
|
on_data_loaded()
|
||||||
|
|
||||||
|
func set_item_data(new_item: ItemData) -> void:
|
||||||
|
item = new_item
|
||||||
|
update_texture()
|
||||||
|
|
||||||
|
func update_texture() -> void:
|
||||||
|
if !Engine.is_editor_hint():
|
||||||
|
return
|
||||||
|
if item and sprite:
|
||||||
|
sprite.texture = item.texture
|
||||||
|
|
||||||
|
func on_data_loaded() -> void:
|
||||||
|
dropped = dropped_data.value
|
||||||
|
|
||||||
|
func drop_item() -> void:
|
||||||
|
if dropped:
|
||||||
|
return
|
||||||
|
dropped = true
|
||||||
|
var drop = PICKUP.instantiate() as ItemPickup
|
||||||
|
drop.item_data = item
|
||||||
|
add_child(drop)
|
||||||
|
drop.picked_up.connect(on_item_picked_up)
|
||||||
|
audio.play()
|
||||||
|
|
||||||
|
func on_item_picked_up() -> void:
|
||||||
|
dropped_data.set_value()
|
||||||
1
general/item-dropper/item_dropper.gd.uid
Normal file
1
general/item-dropper/item_dropper.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://ce3vhcig6dc4p
|
||||||
26
general/item-dropper/item_dropper.tscn
Normal file
26
general/item-dropper/item_dropper.tscn
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene format=3 uid="uid://q756h6ku2kjn"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://ce3vhcig6dc4p" path="res://general/item-dropper/item_dropper.gd" id="1_yo2da"]
|
||||||
|
[ext_resource type="Script" uid="uid://bej7822ail7o" path="res://general/persistent_data/persistent_data_handler.gd" id="2_syr8l"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://b7nup12qxtlh" path="res://general/item-dropper/dungeon_discovery.wav" id="2_u0i1k"]
|
||||||
|
|
||||||
|
[node name="ItemDropper" type="Node2D" unique_id=1807553228]
|
||||||
|
script = ExtResource("1_yo2da")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1635927483]
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Sprite2D" unique_id=423753573]
|
||||||
|
offset_left = -40.0
|
||||||
|
offset_top = -24.0
|
||||||
|
offset_right = 43.0
|
||||||
|
offset_bottom = -1.0
|
||||||
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
|
theme_override_constants/outline_size = 6
|
||||||
|
text = "Item Drop "
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=855210117]
|
||||||
|
stream = ExtResource("2_u0i1k")
|
||||||
|
|
||||||
|
[node name="PersistentDataHandler" type="Node" parent="." unique_id=213983155]
|
||||||
|
script = ExtResource("2_syr8l")
|
||||||
|
metadata/_custom_type_script = "uid://bej7822ail7o"
|
||||||
18
general/persistent_data/persistent_data_handler.gd
Normal file
18
general/persistent_data/persistent_data_handler.gd
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
class_name PersistentDataHandler extends Node
|
||||||
|
|
||||||
|
signal data_loaded
|
||||||
|
|
||||||
|
var value := false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
get_value()
|
||||||
|
|
||||||
|
func set_value() -> void:
|
||||||
|
SaveManager.add_persistent_value(get_data_name())
|
||||||
|
|
||||||
|
func get_value() -> void:
|
||||||
|
value = SaveManager.check_persistent_value(get_data_name())
|
||||||
|
data_loaded.emit()
|
||||||
|
|
||||||
|
func get_data_name() -> String:
|
||||||
|
return "%s/%s/%s" % [get_tree().current_scene.scene_file_path, get_parent().name, name]
|
||||||
1
general/persistent_data/persistent_data_handler.gd.uid
Normal file
1
general/persistent_data/persistent_data_handler.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bej7822ail7o
|
||||||
6
general/persistent_data/persistent_data_handler.tscn
Normal file
6
general/persistent_data/persistent_data_handler.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dqwuowiyehr7d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bej7822ail7o" path="res://general/persistent_data/persistent_data_handler.gd" id="1_72b1k"]
|
||||||
|
|
||||||
|
[node name="PersistentDataHandler" type="Node" unique_id=843808896]
|
||||||
|
script = ExtResource("1_72b1k")
|
||||||
34
globals/global_level_manager.gd
Normal file
34
globals/global_level_manager.gd
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
signal level_load_started
|
||||||
|
signal level_loaded
|
||||||
|
signal Tilemap_boudns_change(bounds: Array[Vector2])
|
||||||
|
var current_tilemap_bounds: Array[Vector2]
|
||||||
|
var target_transition: String
|
||||||
|
var position_offset: Vector2
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
await get_tree().process_frame
|
||||||
|
level_loaded.emit()
|
||||||
|
|
||||||
|
func change_tilemap_bounds(bounds: Array[Vector2]) -> void:
|
||||||
|
current_tilemap_bounds = bounds
|
||||||
|
Tilemap_boudns_change.emit(bounds)
|
||||||
|
|
||||||
|
func load_new_level(
|
||||||
|
level_path: String,
|
||||||
|
new_target_transition: String,
|
||||||
|
new_position_offset: Vector2
|
||||||
|
) -> void:
|
||||||
|
get_tree().paused = true
|
||||||
|
target_transition = new_target_transition
|
||||||
|
position_offset = new_position_offset
|
||||||
|
var tree = get_tree()
|
||||||
|
await SceneTransition.fade_out()
|
||||||
|
level_load_started.emit()
|
||||||
|
await SceneTransition.fade_in()
|
||||||
|
tree.change_scene_to_file(level_path)
|
||||||
|
await tree.process_frame
|
||||||
|
tree.paused = false
|
||||||
|
await tree.process_frame
|
||||||
|
level_loaded.emit()
|
||||||
1
globals/global_level_manager.gd.uid
Normal file
1
globals/global_level_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://d1yritt1yngf1
|
||||||
35
globals/global_player_manager.gd
Normal file
35
globals/global_player_manager.gd
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
const PLAYER = preload("res://player/player.tscn")
|
||||||
|
const INVENTORY_DATA: InventoryData = preload("res://gui/pause/inventory/player_inventory.tres")
|
||||||
|
|
||||||
|
signal interact_pressed
|
||||||
|
|
||||||
|
var player: Player
|
||||||
|
var player_spawned: bool = false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
add_player_instance()
|
||||||
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
player_spawned = true
|
||||||
|
|
||||||
|
func add_player_instance() -> void:
|
||||||
|
player = PLAYER.instantiate()
|
||||||
|
add_child(player)
|
||||||
|
|
||||||
|
func set_player_position(new_pos: Vector2) -> void:
|
||||||
|
player.global_position = new_pos
|
||||||
|
|
||||||
|
func set_as_parent(node: Node2D) -> void:
|
||||||
|
var players_parent = player.get_parent()
|
||||||
|
if players_parent:
|
||||||
|
players_parent.remove_child(player)
|
||||||
|
node.add_child(player)
|
||||||
|
|
||||||
|
func unparent_player(node: Node2D) -> void:
|
||||||
|
node.remove_child(player)
|
||||||
|
|
||||||
|
func set_health(hp: int, max_hp: int) -> void:
|
||||||
|
PlayerManager.player.maxHp = max_hp
|
||||||
|
PlayerManager.player.hp = hp
|
||||||
|
PlayerManager.player.update_hp(0)
|
||||||
1
globals/global_player_manager.gd.uid
Normal file
1
globals/global_player_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dcqwe4meucgrn
|
||||||
74
globals/global_save_manager.gd
Normal file
74
globals/global_save_manager.gd
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
const SAVE_PATH := "user://"
|
||||||
|
|
||||||
|
signal game_loaded
|
||||||
|
signal game_saved
|
||||||
|
|
||||||
|
var current_save := {
|
||||||
|
scene_path = "",
|
||||||
|
player = {
|
||||||
|
hp = 1,
|
||||||
|
max_hp = 1,
|
||||||
|
pos_x = 0,
|
||||||
|
pos_y = 0
|
||||||
|
},
|
||||||
|
items = [],
|
||||||
|
persistence = [],
|
||||||
|
quests = [],
|
||||||
|
}
|
||||||
|
|
||||||
|
func save_game() -> void:
|
||||||
|
update_player_data()
|
||||||
|
update_scene_path()
|
||||||
|
update_item_data()
|
||||||
|
write_save(JSON.stringify(current_save))
|
||||||
|
game_saved.emit()
|
||||||
|
|
||||||
|
func load_game() -> void:
|
||||||
|
current_save = read_save()
|
||||||
|
|
||||||
|
LevelManager.load_new_level(current_save.scene_path, "", Vector2.ZERO)
|
||||||
|
await LevelManager.level_load_started
|
||||||
|
PlayerManager.set_player_position(Vector2(current_save.player.pos_x, current_save.player.pos_y))
|
||||||
|
PlayerManager.set_health(current_save.player.hp, current_save.player.max_hp)
|
||||||
|
PlayerManager.INVENTORY_DATA.load_save_date(current_save.items)
|
||||||
|
await LevelManager.level_loaded
|
||||||
|
game_loaded.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func update_player_data() -> void:
|
||||||
|
var player := PlayerManager.player
|
||||||
|
current_save.player.hp = player.hp
|
||||||
|
current_save.player.max_hp = player.maxHp
|
||||||
|
current_save.player.pos_x = player.global_position.x
|
||||||
|
current_save.player.pos_y = player.global_position.y
|
||||||
|
|
||||||
|
func update_scene_path() -> void:
|
||||||
|
var path := ""
|
||||||
|
for child in get_tree().root.get_children():
|
||||||
|
if child is Level:
|
||||||
|
path = child.scene_file_path
|
||||||
|
current_save.scene_path = path
|
||||||
|
|
||||||
|
func write_save(content: String) -> void:
|
||||||
|
var file := FileAccess.open(SAVE_PATH + "save.sav", FileAccess.WRITE)
|
||||||
|
file.store_line(content)
|
||||||
|
|
||||||
|
func read_save() -> Dictionary:
|
||||||
|
var file := FileAccess.open(SAVE_PATH + "save.sav", FileAccess.READ)
|
||||||
|
var json = JSON.new()
|
||||||
|
json.parse(file.get_line())
|
||||||
|
return json.get_data() as Dictionary
|
||||||
|
|
||||||
|
func update_item_data() -> void:
|
||||||
|
current_save.items = PlayerManager.INVENTORY_DATA.get_save_data()
|
||||||
|
|
||||||
|
func add_persistent_value(value: String) -> void:
|
||||||
|
if check_persistent_value(value):
|
||||||
|
return
|
||||||
|
current_save.persistence.append(value)
|
||||||
|
|
||||||
|
func check_persistent_value(value: String) -> bool:
|
||||||
|
var persistent_data := current_save.persistence as Array
|
||||||
|
return persistent_data.has(value)
|
||||||
1
globals/global_save_manager.gd.uid
Normal file
1
globals/global_save_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c547xrdujao7w
|
||||||
BIN
gui/hud/gui-health.png
Normal file
BIN
gui/hud/gui-health.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 394 B |
40
gui/hud/gui-health.png.import
Normal file
40
gui/hud/gui-health.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://csf8yqiq5fs5n"
|
||||||
|
path="res://.godot/imported/gui-health.png-d93a49566652243a8143d8e668d232ff.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://gui/hud/gui-health.png"
|
||||||
|
dest_files=["res://.godot/imported/gui-health.png-d93a49566652243a8143d8e668d232ff.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
|
||||||
11
gui/hud/heart.gd
Normal file
11
gui/hud/heart.gd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class_name HeartGUI extends Control
|
||||||
|
|
||||||
|
@onready var sprite: Sprite2D = $HeartSprite
|
||||||
|
|
||||||
|
var value: int = 2 :
|
||||||
|
set(_value):
|
||||||
|
value = _value
|
||||||
|
update_sprite()
|
||||||
|
|
||||||
|
func update_sprite() -> void:
|
||||||
|
sprite.frame = value
|
||||||
1
gui/hud/heart.gd.uid
Normal file
1
gui/hud/heart.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bacc4v8q6cvlb
|
||||||
17
gui/hud/heart.tscn
Normal file
17
gui/hud/heart.tscn
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bpe1y2o6gsmlv"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bacc4v8q6cvlb" path="res://gui/hud/heart.gd" id="1_5rmhy"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://csf8yqiq5fs5n" path="res://gui/hud/gui-health.png" id="1_7gnmf"]
|
||||||
|
|
||||||
|
[node name="Heart" type="Control" unique_id=1010364190]
|
||||||
|
visible = false
|
||||||
|
custom_minimum_size = Vector2(9, 0)
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
script = ExtResource("1_5rmhy")
|
||||||
|
|
||||||
|
[node name="HeartSprite" type="Sprite2D" parent="." unique_id=424664538]
|
||||||
|
texture = ExtResource("1_7gnmf")
|
||||||
|
centered = false
|
||||||
|
hframes = 7
|
||||||
|
vframes = 2
|
||||||
22
gui/hud/hud.gd
Normal file
22
gui/hud/hud.gd
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
extends CanvasLayer
|
||||||
|
|
||||||
|
var hearts: Array[HeartGUI] = []
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
for child in $control/HFlowContainer.get_children():
|
||||||
|
if child is HeartGUI:
|
||||||
|
hearts.append(child)
|
||||||
|
child.visible = false
|
||||||
|
|
||||||
|
func update_hp(hp: int, max_hp: int) -> void:
|
||||||
|
update_max_hp(max_hp)
|
||||||
|
for i in max_hp:
|
||||||
|
update_heart(i, hp)
|
||||||
|
|
||||||
|
func update_heart(index: int, hp: int) -> void:
|
||||||
|
hearts[index].value = clampi(hp - index * 2, 0, 2)
|
||||||
|
|
||||||
|
func update_max_hp(max_hp: int) -> void:
|
||||||
|
var heart_count: int = roundi(max_hp * 0.5)
|
||||||
|
for i in hearts.size():
|
||||||
|
hearts[i].visible = i < heart_count
|
||||||
1
gui/hud/hud.gd.uid
Normal file
1
gui/hud/hud.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cvupqrfocd635
|
||||||
94
gui/hud/hud.tscn
Normal file
94
gui/hud/hud.tscn
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dwon5dsqxao56"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://csf8yqiq5fs5n" path="res://gui/hud/gui-health.png" id="1_4w87a"]
|
||||||
|
[ext_resource type="Script" uid="uid://cvupqrfocd635" path="res://gui/hud/hud.gd" id="1_rllpj"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bpe1y2o6gsmlv" path="res://gui/hud/heart.tscn" id="2_rllpj"]
|
||||||
|
|
||||||
|
[node name="hud" type="CanvasLayer" unique_id=256487066]
|
||||||
|
layer = 2
|
||||||
|
script = ExtResource("1_rllpj")
|
||||||
|
|
||||||
|
[node name="control" type="Control" parent="." unique_id=1112650233]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
|
[node name="health_sprite" type="Sprite2D" parent="control" unique_id=1001694164]
|
||||||
|
position = Vector2(387, 9)
|
||||||
|
texture = ExtResource("1_4w87a")
|
||||||
|
region_enabled = true
|
||||||
|
region_rect = Rect2(30, 0, 33, 8)
|
||||||
|
|
||||||
|
[node name="HFlowContainer" type="HFlowContainer" parent="control" unique_id=1403418063]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 322.0
|
||||||
|
offset_top = 17.0
|
||||||
|
offset_right = 452.0
|
||||||
|
offset_bottom = 50.0
|
||||||
|
theme_override_constants/h_separation = 4
|
||||||
|
theme_override_constants/v_separation = 2
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Heart" parent="control/HFlowContainer" unique_id=1010364190 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart2" parent="control/HFlowContainer" unique_id=1093190859 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart3" parent="control/HFlowContainer" unique_id=2139127460 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart4" parent="control/HFlowContainer" unique_id=2098524055 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart5" parent="control/HFlowContainer" unique_id=784572064 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart6" parent="control/HFlowContainer" unique_id=1170384884 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart7" parent="control/HFlowContainer" unique_id=488907353 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart8" parent="control/HFlowContainer" unique_id=2092404839 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart9" parent="control/HFlowContainer" unique_id=642254142 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart10" parent="control/HFlowContainer" unique_id=1150287437 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart11" parent="control/HFlowContainer" unique_id=1332044652 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart12" parent="control/HFlowContainer" unique_id=1873062161 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart13" parent="control/HFlowContainer" unique_id=809306772 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart14" parent="control/HFlowContainer" unique_id=1383244089 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart15" parent="control/HFlowContainer" unique_id=749427884 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart16" parent="control/HFlowContainer" unique_id=1553915001 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart17" parent="control/HFlowContainer" unique_id=432065662 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart18" parent="control/HFlowContainer" unique_id=21663377 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart19" parent="control/HFlowContainer" unique_id=1650662833 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Heart20" parent="control/HFlowContainer" unique_id=705981093 instance=ExtResource("2_rllpj")]
|
||||||
|
layout_mode = 2
|
||||||
29
gui/pause/inventory/inventory_slot.tscn
Normal file
29
gui/pause/inventory/inventory_slot.tscn
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
[gd_scene format=3 uid="uid://b2r6mp7h13pak"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dxf00vjmse6ab" path="res://items/sprites/items.png" id="1_gwc7x"]
|
||||||
|
[ext_resource type="Script" uid="uid://cvbri6j1mbq07" path="res://gui/pause/inventory/scripts/inventory_slot_ui.gd" id="1_s0lov"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_s0lov"]
|
||||||
|
atlas = ExtResource("1_gwc7x")
|
||||||
|
region = Rect2(0, 0, 32, 32)
|
||||||
|
|
||||||
|
[node name="InventorySlot" type="Button" unique_id=823052233]
|
||||||
|
custom_minimum_size = Vector2(32, 32)
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 32.0
|
||||||
|
script = ExtResource("1_s0lov")
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="." unique_id=469228245]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 32.0
|
||||||
|
texture = SubResource("AtlasTexture_s0lov")
|
||||||
|
stretch_mode = 3
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="." unique_id=385106309]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 16.0
|
||||||
|
theme_override_font_sizes/font_size = 8
|
||||||
|
text = "99"
|
||||||
|
horizontal_alignment = 2
|
||||||
9
gui/pause/inventory/player_inventory.tres
Normal file
9
gui/pause/inventory/player_inventory.tres
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="InventoryData" format=3 uid="uid://8eo5dhh10mag"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://b6ol0ja8441tv" path="res://gui/pause/inventory/scripts/inventory_data.gd" id="1_i443n"]
|
||||||
|
[ext_resource type="Script" uid="uid://d0boqgd4kawwt" path="res://gui/pause/inventory/scripts/slot_data.gd" id="2_pk4bu"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_i443n")
|
||||||
|
slots = Array[ExtResource("2_pk4bu")]([null, null, null, null, null, null, null, null, null, null])
|
||||||
|
metadata/_custom_type_script = "uid://b6ol0ja8441tv"
|
||||||
88
gui/pause/inventory/scripts/inventory_data.gd
Normal file
88
gui/pause/inventory/scripts/inventory_data.gd
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
class_name InventoryData extends Resource
|
||||||
|
|
||||||
|
@export var slots: Array[SlotData]
|
||||||
|
|
||||||
|
func _init() -> void:
|
||||||
|
connect_slots()
|
||||||
|
|
||||||
|
func add_item(item: ItemData, count := 1) -> bool:
|
||||||
|
var slot = get_slot_by_item(item)
|
||||||
|
if slot:
|
||||||
|
slot.quantity += count
|
||||||
|
return true
|
||||||
|
var empty_slot_index = get_empty_slot_index()
|
||||||
|
if empty_slot_index > -1:
|
||||||
|
var new_slot = SlotData.new()
|
||||||
|
new_slot.item_data = item
|
||||||
|
new_slot.quantity = count
|
||||||
|
slots[empty_slot_index] = new_slot
|
||||||
|
new_slot.changed.connect(on_slot_changed)
|
||||||
|
return true
|
||||||
|
print("inventory full")
|
||||||
|
return false
|
||||||
|
|
||||||
|
func get_slot_by_item(item: ItemData) -> SlotData:
|
||||||
|
var index = slots.find_custom(func(slot: SlotData): return slot != null and slot.item_data == item)
|
||||||
|
if index > -1:
|
||||||
|
return slots[index]
|
||||||
|
return null
|
||||||
|
|
||||||
|
func get_empty_slot_index() -> int:
|
||||||
|
return slots.find_custom(func(slot: SlotData): return !slot)
|
||||||
|
|
||||||
|
func get_valid_slots() -> Array[SlotData]:
|
||||||
|
return slots.filter(func(slot: SlotData): return slot);
|
||||||
|
|
||||||
|
func connect_slots() -> void:
|
||||||
|
for slot: SlotData in get_valid_slots():
|
||||||
|
slot.changed.connect(on_slot_changed)
|
||||||
|
|
||||||
|
func on_slot_changed() -> void:
|
||||||
|
for slot_index in slots.size():
|
||||||
|
var slot: SlotData = slots[slot_index]
|
||||||
|
if slot and slot.quantity < 1:
|
||||||
|
slot.changed.disconnect(on_slot_changed)
|
||||||
|
slots[slot_index] = null
|
||||||
|
emit_changed()
|
||||||
|
|
||||||
|
func get_save_data() -> Array:
|
||||||
|
var item_save := []
|
||||||
|
for slot in slots:
|
||||||
|
item_save.append(item_to_save(slot))
|
||||||
|
return item_save
|
||||||
|
|
||||||
|
func item_to_save(slot: SlotData) -> Dictionary:
|
||||||
|
var result := {
|
||||||
|
item = "",
|
||||||
|
quantity = 0
|
||||||
|
}
|
||||||
|
if !slot:
|
||||||
|
return result
|
||||||
|
result.quantity = slot.quantity
|
||||||
|
if !slot.item_data:
|
||||||
|
return result
|
||||||
|
result.item = slot.item_data.resource_path
|
||||||
|
return result
|
||||||
|
|
||||||
|
func load_save_date(save_data: Array) -> void:
|
||||||
|
var slots_size = slots.size()
|
||||||
|
slots.clear()
|
||||||
|
slots.resize(slots_size)
|
||||||
|
for save_index in save_data.size():
|
||||||
|
slots[save_index] = save_to_item(save_data[save_index])
|
||||||
|
connect_slots()
|
||||||
|
|
||||||
|
func save_to_item(save_item: Dictionary) -> SlotData:
|
||||||
|
if save_item.item == "":
|
||||||
|
return null
|
||||||
|
var new_slot := SlotData.new()
|
||||||
|
new_slot.item_data = load(save_item.item)
|
||||||
|
new_slot.quantity = int(save_item.quantity)
|
||||||
|
return new_slot
|
||||||
|
|
||||||
|
func use_item(item: ItemData, count := 1) -> bool:
|
||||||
|
for slot in slots:
|
||||||
|
if slot and slot.item_data == item and slot.quantity >= count:
|
||||||
|
slot.quantity -= count
|
||||||
|
return true
|
||||||
|
return false
|
||||||
1
gui/pause/inventory/scripts/inventory_data.gd.uid
Normal file
1
gui/pause/inventory/scripts/inventory_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b6ol0ja8441tv
|
||||||
38
gui/pause/inventory/scripts/inventory_slot_ui.gd
Normal file
38
gui/pause/inventory/scripts/inventory_slot_ui.gd
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
class_name InventorySlotUi extends Button
|
||||||
|
|
||||||
|
var slot_data: SlotData :
|
||||||
|
set = set_slot_data
|
||||||
|
|
||||||
|
@onready var texture_rect: TextureRect = $TextureRect
|
||||||
|
@onready var label: Label = $Label
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
texture_rect.texture = null
|
||||||
|
label.text = ""
|
||||||
|
focus_entered.connect(on_item_focus)
|
||||||
|
focus_exited.connect(on_item_unfocus)
|
||||||
|
pressed.connect(item_pressed)
|
||||||
|
|
||||||
|
func set_slot_data(value: SlotData) -> void:
|
||||||
|
slot_data = value
|
||||||
|
if slot_data == null:
|
||||||
|
return
|
||||||
|
texture_rect.texture = slot_data.item_data.texture
|
||||||
|
label.text = str(slot_data.quantity)
|
||||||
|
|
||||||
|
func on_item_focus() -> void:
|
||||||
|
if slot_data == null or slot_data.item_data == null:
|
||||||
|
return
|
||||||
|
PauseMenu.update_item_description(slot_data.item_data.description)
|
||||||
|
|
||||||
|
func on_item_unfocus() -> void:
|
||||||
|
PauseMenu.update_item_description("")
|
||||||
|
pass
|
||||||
|
|
||||||
|
func item_pressed() -> void:
|
||||||
|
if !slot_data or !slot_data.item_data:
|
||||||
|
return
|
||||||
|
if !slot_data.item_data.use():
|
||||||
|
return
|
||||||
|
slot_data.quantity -= 1
|
||||||
|
label.text = str(slot_data.quantity)
|
||||||
1
gui/pause/inventory/scripts/inventory_slot_ui.gd.uid
Normal file
1
gui/pause/inventory/scripts/inventory_slot_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cvbri6j1mbq07
|
||||||
37
gui/pause/inventory/scripts/inventory_ui.gd
Normal file
37
gui/pause/inventory/scripts/inventory_ui.gd
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
class_name InventoryUi extends Control
|
||||||
|
|
||||||
|
const INVENTORY_SLOT = preload("res://gui/pause/inventory/inventory_slot.tscn")
|
||||||
|
|
||||||
|
@export var data: InventoryData
|
||||||
|
|
||||||
|
var focus_index := 1
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
PauseMenu.shown.connect(update)
|
||||||
|
PauseMenu.hidden.connect(clear)
|
||||||
|
clear()
|
||||||
|
data.changed.connect(on_inventory_changed)
|
||||||
|
|
||||||
|
func clear() -> void:
|
||||||
|
for child in get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
|
func update() -> void:
|
||||||
|
for slot in data.slots:
|
||||||
|
var new_slot = INVENTORY_SLOT.instantiate()
|
||||||
|
add_child(new_slot)
|
||||||
|
new_slot.slot_data = slot
|
||||||
|
new_slot.focus_entered.connect(on_item_focused)
|
||||||
|
if !data.slots.is_empty():
|
||||||
|
await get_tree().process_frame
|
||||||
|
get_child(focus_index).grab_focus()
|
||||||
|
|
||||||
|
func on_inventory_changed() -> void:
|
||||||
|
clear()
|
||||||
|
update()
|
||||||
|
|
||||||
|
func on_item_focused() -> void:
|
||||||
|
for child_index in get_child_count():
|
||||||
|
if get_child(child_index).has_focus():
|
||||||
|
focus_index = child_index
|
||||||
|
return
|
||||||
1
gui/pause/inventory/scripts/inventory_ui.gd.uid
Normal file
1
gui/pause/inventory/scripts/inventory_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b7a5u5kcishd4
|
||||||
9
gui/pause/inventory/scripts/slot_data.gd
Normal file
9
gui/pause/inventory/scripts/slot_data.gd
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
class_name SlotData extends Resource
|
||||||
|
|
||||||
|
@export var item_data: ItemData
|
||||||
|
@export var quantity := 0 : set = set_quantity
|
||||||
|
|
||||||
|
func set_quantity(new_quantity: int) -> void:
|
||||||
|
quantity = new_quantity
|
||||||
|
if quantity < 1:
|
||||||
|
emit_changed()
|
||||||
1
gui/pause/inventory/scripts/slot_data.gd.uid
Normal file
1
gui/pause/inventory/scripts/slot_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://d0boqgd4kawwt
|
||||||
56
gui/pause/pause.gd
Normal file
56
gui/pause/pause.gd
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
extends CanvasLayer
|
||||||
|
|
||||||
|
signal shown
|
||||||
|
signal hidden
|
||||||
|
|
||||||
|
@onready var save_button: Button = $Control/HBoxContainer/Save
|
||||||
|
@onready var load_button: Button = $Control/HBoxContainer/Load
|
||||||
|
@onready var item_description: Label = $Control/ItemDescription
|
||||||
|
@onready var audio_player: AudioStreamPlayer = $Control/AudioStreamPlayer
|
||||||
|
|
||||||
|
var is_paused := false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
hide_pause()
|
||||||
|
save_button.pressed.connect(on_save)
|
||||||
|
load_button.pressed.connect(on_load)
|
||||||
|
|
||||||
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
if event.is_action_pressed("pause"):
|
||||||
|
if !is_paused:
|
||||||
|
show_pause()
|
||||||
|
else:
|
||||||
|
hide_pause()
|
||||||
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
|
func show_pause() -> void:
|
||||||
|
get_tree().paused = true
|
||||||
|
visible = true
|
||||||
|
is_paused = true
|
||||||
|
shown.emit()
|
||||||
|
|
||||||
|
func hide_pause() -> void:
|
||||||
|
get_tree().paused = false
|
||||||
|
visible = false
|
||||||
|
is_paused = false
|
||||||
|
hidden.emit()
|
||||||
|
|
||||||
|
func on_save() -> void:
|
||||||
|
if !is_paused:
|
||||||
|
return
|
||||||
|
SaveManager.save_game()
|
||||||
|
hide_pause()
|
||||||
|
|
||||||
|
func on_load() -> void:
|
||||||
|
if !is_paused:
|
||||||
|
return
|
||||||
|
SaveManager.load_game()
|
||||||
|
await LevelManager.level_load_started
|
||||||
|
hide_pause()
|
||||||
|
|
||||||
|
func update_item_description(new_description: String) -> void:
|
||||||
|
item_description.text = new_description
|
||||||
|
|
||||||
|
func play_audio(audio: AudioStream) -> void:
|
||||||
|
audio_player.stream = audio
|
||||||
|
audio_player.play()
|
||||||
1
gui/pause/pause.gd.uid
Normal file
1
gui/pause/pause.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dg1igfflunr7n
|
||||||
116
gui/pause/pause.tscn
Normal file
116
gui/pause/pause.tscn
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dr37gne0tsx3h"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dg1igfflunr7n" path="res://gui/pause/pause.gd" id="1_syqp4"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dxf00vjmse6ab" path="res://items/sprites/items.png" id="2_3oqg8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b2r6mp7h13pak" path="res://gui/pause/inventory/inventory_slot.tscn" id="3_ev3e7"]
|
||||||
|
[ext_resource type="Script" uid="uid://b7a5u5kcishd4" path="res://gui/pause/inventory/scripts/inventory_ui.gd" id="3_g4auy"]
|
||||||
|
[ext_resource type="Resource" uid="uid://8eo5dhh10mag" path="res://gui/pause/inventory/player_inventory.tres" id="4_nr23h"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ev3e7"]
|
||||||
|
atlas = ExtResource("2_3oqg8")
|
||||||
|
region = Rect2(96, 0, 32, 32)
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_g4auy"]
|
||||||
|
content_margin_left = 10.0
|
||||||
|
content_margin_top = 10.0
|
||||||
|
content_margin_right = 10.0
|
||||||
|
content_margin_bottom = 10.0
|
||||||
|
texture = SubResource("AtlasTexture_ev3e7")
|
||||||
|
texture_margin_left = 14.0
|
||||||
|
texture_margin_top = 14.0
|
||||||
|
texture_margin_right = 14.0
|
||||||
|
texture_margin_bottom = 14.0
|
||||||
|
|
||||||
|
[node name="Pause" type="CanvasLayer" unique_id=61680245]
|
||||||
|
process_mode = 3
|
||||||
|
script = ExtResource("1_syqp4")
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="." unique_id=220122734]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Control" unique_id=131716919]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.23392546, 0.23392546, 0.2339254, 0.61960787)
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="Control" unique_id=1624860206]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 2
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -31.0
|
||||||
|
offset_right = 154.0
|
||||||
|
grow_vertical = 0
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 8
|
||||||
|
|
||||||
|
[node name="Save" type="Button" parent="Control/HBoxContainer" unique_id=1562812412]
|
||||||
|
custom_minimum_size = Vector2(75, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Save"
|
||||||
|
|
||||||
|
[node name="Load" type="Button" parent="Control/HBoxContainer" unique_id=673890119]
|
||||||
|
custom_minimum_size = Vector2(75, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Load"
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Control" unique_id=631151135]
|
||||||
|
layout_mode = 1
|
||||||
|
offset_right = 80.0
|
||||||
|
offset_bottom = 23.0
|
||||||
|
text = "[ paused ]"
|
||||||
|
|
||||||
|
[node name="ItemDescription" type="Label" parent="Control" unique_id=1498356388]
|
||||||
|
layout_mode = 1
|
||||||
|
offset_top = 184.0
|
||||||
|
offset_right = 192.0
|
||||||
|
offset_bottom = 208.0
|
||||||
|
theme_override_font_sizes/font_size = 10
|
||||||
|
autowrap_mode = 2
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=1571046276]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 4
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_top = -44.0
|
||||||
|
offset_right = 196.0
|
||||||
|
offset_bottom = 44.0
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_styles/panel = SubResource("StyleBoxTexture_g4auy")
|
||||||
|
|
||||||
|
[node name="GridContainer" type="GridContainer" parent="Control/PanelContainer" unique_id=1929711512]
|
||||||
|
layout_mode = 2
|
||||||
|
columns = 5
|
||||||
|
script = ExtResource("3_g4auy")
|
||||||
|
data = ExtResource("4_nr23h")
|
||||||
|
|
||||||
|
[node name="InventorySlot" parent="Control/PanelContainer/GridContainer" unique_id=823052233 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="InventorySlot2" parent="Control/PanelContainer/GridContainer" unique_id=479001907 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="InventorySlot3" parent="Control/PanelContainer/GridContainer" unique_id=327293097 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="InventorySlot4" parent="Control/PanelContainer/GridContainer" unique_id=355127191 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="InventorySlot5" parent="Control/PanelContainer/GridContainer" unique_id=1654439347 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="InventorySlot6" parent="Control/PanelContainer/GridContainer" unique_id=786772334 instance=ExtResource("3_ev3e7")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="Control" unique_id=838536062]
|
||||||
|
max_polyphony = 4
|
||||||
15
gui/scene_transition/scene_transition.gd
Normal file
15
gui/scene_transition/scene_transition.gd
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
extends CanvasLayer
|
||||||
|
|
||||||
|
@onready var animation_player: AnimationPlayer = $Control/AnimationPlayer
|
||||||
|
|
||||||
|
func fade_out() -> bool:
|
||||||
|
animation_player.play("fade_out")
|
||||||
|
await animation_player.animation_finished
|
||||||
|
return true
|
||||||
|
|
||||||
|
func fade_in() -> bool:
|
||||||
|
animation_player.play("fade_in")
|
||||||
|
await animation_player.animation_finished
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
1
gui/scene_transition/scene_transition.gd.uid
Normal file
1
gui/scene_transition/scene_transition.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bj8b41e1xb3uq
|
||||||
98
gui/scene_transition/scene_transition.tscn
Normal file
98
gui/scene_transition/scene_transition.tscn
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
[gd_scene format=3 uid="uid://c4iyg64sd02rx"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bj8b41e1xb3uq" path="res://gui/scene_transition/scene_transition.gd" id="1_yvyfr"]
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_ex1eg"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("ColorRect:color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_yvyfr"]
|
||||||
|
resource_name = "default"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("ColorRect:color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_jxmsx"]
|
||||||
|
resource_name = "fade_in"
|
||||||
|
length = 0.2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("ColorRect:color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_ivw6h"]
|
||||||
|
resource_name = "fade_out"
|
||||||
|
length = 0.2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("ColorRect:color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7lt87"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_ex1eg"),
|
||||||
|
&"default": SubResource("Animation_yvyfr"),
|
||||||
|
&"fade_in": SubResource("Animation_jxmsx"),
|
||||||
|
&"fade_out": SubResource("Animation_ivw6h")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="SceneTransition" type="CanvasLayer" unique_id=1326424867]
|
||||||
|
process_mode = 3
|
||||||
|
script = ExtResource("1_yvyfr")
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="." unique_id=358311519]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Control" unique_id=1705459741]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0, 0, 0, 0)
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="Control" unique_id=418775104]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_7lt87")
|
||||||
|
autoplay = &"default"
|
||||||
1
icon.svg
Normal file
1
icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 995 B |
43
icon.svg.import
Normal file
43
icon.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://vqte157godwi"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
206
interactables/dungeon/barred_door.tscn
Normal file
206
interactables/dungeon/barred_door.tscn
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bc7hmfth8je8e"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c7b0f1rtxh6ef" path="res://interactables/dungeon/scripts/barred_door.gd" id="1_2y4v6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bs2wf6avylmry" path="res://interactables/dungeon/dungeon_props.png" id="1_t1hsr"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://cqg2hh5dpvbbf" path="res://interactables/dungeon/bars_open.wav" id="2_1lmnq"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t1hsr"]
|
||||||
|
size = Vector2(64, 66)
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_t1hsr"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite2D:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_wgpnr"]
|
||||||
|
resource_name = "close_door"
|
||||||
|
step = 0.075
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite2D:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.07692307, 0.15384616, 0.23076925, 0.30769232),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [5, 4, 3, 2, 1]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("AudioStreamPlayer2D")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("2_1lmnq")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_1lmnq"]
|
||||||
|
resource_name = "closed"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite2D:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_7b8gh"]
|
||||||
|
resource_name = "open_door"
|
||||||
|
step = 0.075
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite2D:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.07692308, 0.15384616, 0.23076925, 0.30769232),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.30769232),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false, true]
|
||||||
|
}
|
||||||
|
tracks/2/type = "audio"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("AudioStreamPlayer2D")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"clips": [{
|
||||||
|
"end_offset": 0.0,
|
||||||
|
"start_offset": 0.0,
|
||||||
|
"stream": ExtResource("2_1lmnq")
|
||||||
|
}],
|
||||||
|
"times": PackedFloat32Array(0)
|
||||||
|
}
|
||||||
|
tracks/2/use_blend = true
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6rn0f"]
|
||||||
|
resource_name = "opened"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite2D:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [5]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6rn0f"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_t1hsr"),
|
||||||
|
&"close_door": SubResource("Animation_wgpnr"),
|
||||||
|
&"closed": SubResource("Animation_1lmnq"),
|
||||||
|
&"open_door": SubResource("Animation_7b8gh"),
|
||||||
|
&"opened": SubResource("Animation_6rn0f")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="BarredDoor" type="Node2D" unique_id=2031413673]
|
||||||
|
script = ExtResource("1_2y4v6")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=403550058]
|
||||||
|
position = Vector2(32, -40)
|
||||||
|
texture = ExtResource("1_t1hsr")
|
||||||
|
hframes = 7
|
||||||
|
frame = 1
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=1122685930]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 0
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=957511667]
|
||||||
|
position = Vector2(32, -31)
|
||||||
|
shape = SubResource("RectangleShape2D_t1hsr")
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1329199452]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_6rn0f")
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=637726511]
|
||||||
BIN
interactables/dungeon/bars_open.wav
Normal file
BIN
interactables/dungeon/bars_open.wav
Normal file
Binary file not shown.
24
interactables/dungeon/bars_open.wav.import
Normal file
24
interactables/dungeon/bars_open.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cqg2hh5dpvbbf"
|
||||||
|
path="res://.godot/imported/bars_open.wav-e0c7e41fce1e0698d8f47757944327a0.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interactables/dungeon/bars_open.wav"
|
||||||
|
dest_files=["res://.godot/imported/bars_open.wav-e0c7e41fce1e0698d8f47757944327a0.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
BIN
interactables/dungeon/dungeon_props.png
Normal file
BIN
interactables/dungeon/dungeon_props.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
40
interactables/dungeon/dungeon_props.png.import
Normal file
40
interactables/dungeon/dungeon_props.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bs2wf6avylmry"
|
||||||
|
path="res://.godot/imported/dungeon_props.png-420811059f32bd32994907959c16b76b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interactables/dungeon/dungeon_props.png"
|
||||||
|
dest_files=["res://.godot/imported/dungeon_props.png-420811059f32bd32994907959c16b76b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
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/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
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
interactables/dungeon/lever-01.wav
Normal file
BIN
interactables/dungeon/lever-01.wav
Normal file
Binary file not shown.
24
interactables/dungeon/lever-01.wav.import
Normal file
24
interactables/dungeon/lever-01.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://d8gubxeubi5s"
|
||||||
|
path="res://.godot/imported/lever-01.wav-765aef4f552fd0351cf314055bf3f5aa.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interactables/dungeon/lever-01.wav"
|
||||||
|
dest_files=["res://.godot/imported/lever-01.wav-765aef4f552fd0351cf314055bf3f5aa.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user