beta-1.3/restructure-files (#2)
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://cd3iyspcdg8m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0fsmtp1umvmp" path="res://Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd" id="1_6u2sl"]
|
||||
|
||||
[node name="Base Chest" type="StaticBody2D" unique_id=975880832 groups=["Treasure Chest Group"]]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_6u2sl")
|
||||
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://cncm0c4dmosgs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dbuc0f87m24xf" path="res://Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd" id="1_mkt0u"]
|
||||
|
||||
[node name="Base Item Chest" type="StaticBody2D" unique_id=991903258]
|
||||
script = ExtResource("1_mkt0u")
|
||||
metadata/_custom_type_script = "uid://0fsmtp1umvmp"
|
||||
@@ -0,0 +1,105 @@
|
||||
[gd_scene format=3 uid="uid://byp273amg5ji8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_lp0kr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_iwcc8"]
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="3_iwcc8"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_0r744"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 01" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_lp0kr")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_iwcc8")]
|
||||
sprite_frames = SubResource("SpriteFrames_0r744")
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
@@ -0,0 +1,106 @@
|
||||
[gd_scene format=3 uid="uid://b7u4hlvuqiefn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_77oue"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_jpeii"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcbk854sc3uud" path="res://Assets/Spritesheets/Home Decor/Metal_Chest_Anim.png" id="3_jpeii"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1k0b3"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydgix"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s4uuj"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f64hp"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xb452"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mmcbf"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p1iln"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wsmdh"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_2qcbe"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1k0b3")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ydgix")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s4uuj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f64hp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xb452")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mmcbf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_p1iln")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wsmdh")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 02" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_77oue")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_jpeii")]
|
||||
sprite_frames = SubResource("SpriteFrames_2qcbe")
|
||||
animation = &"opening"
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends StaticBody2D
|
||||
class_name BaseChest
|
||||
|
||||
signal OpeningAnimationStarted
|
||||
|
||||
@export var is_open := false
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
is_open = true
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://0fsmtp1umvmp
|
||||
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
@@ -0,0 +1,4 @@
|
||||
extends BaseChest
|
||||
class_name BaseItemChest
|
||||
|
||||
@export var item_id: Enums.Items
|
||||
@@ -0,0 +1 @@
|
||||
uid://dbuc0f87m24xf
|
||||
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends BaseItemChest
|
||||
|
||||
@onready var chest_01_sprite: AnimatedSprite2D = $"Sprite"
|
||||
|
||||
@export var is_locked := false
|
||||
@export var locked_message_dialogue_trigger: DialogueTrigger
|
||||
@export var already_opened_message_dialogue_trigger: DialogueTrigger
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
if is_locked:
|
||||
if locked_message_dialogue_trigger:
|
||||
locked_message_dialogue_trigger.Trigger()
|
||||
return
|
||||
|
||||
super.Open()
|
||||
|
||||
OpeningAnimationStarted.emit()
|
||||
chest_01_sprite.play("opening")
|
||||
|
||||
var item_name: String = Enums.Items.keys()[item_id]
|
||||
print(item_name)
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
if already_opened_message_dialogue_trigger:
|
||||
already_opened_message_dialogue_trigger.Trigger()
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
if is_open:
|
||||
chest_01_sprite.play("opened")
|
||||
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bvq13h8uyx572
|
||||
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
@@ -0,0 +1,84 @@
|
||||
[gd_scene format=3 uid="uid://d3rqn611axsfk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="1_8m6gq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_sx0xc"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="Chest01 Sprite" type="AnimatedSprite2D" unique_id=1811986888]
|
||||
y_sort_enabled = true
|
||||
sprite_frames = SubResource("SpriteFrames_sx0xc")
|
||||
animation = &"closed"
|
||||
autoplay = "closed"
|
||||
offset = Vector2(0, -6)
|
||||
@@ -0,0 +1,2 @@
|
||||
extends StaticBody2D
|
||||
class_name WoodenBench
|
||||
@@ -0,0 +1 @@
|
||||
uid://c6n652dy18xbm
|
||||
48
Entities/Map Objects/Decorative/Outdoor/wooden_bench.tscn
Normal file
48
Entities/Map Objects/Decorative/Outdoor/wooden_bench.tscn
Normal file
@@ -0,0 +1,48 @@
|
||||
[gd_scene format=3 uid="uid://23tpba4r6ucg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://nocnsf1xr3ap" path="res://Assets/Spritesheets/Outdoor Decor/Benches.png" id="1_jlu4v"]
|
||||
[ext_resource type="Script" uid="uid://c6n652dy18xbm" path="res://Entities/Map Objects/Decorative/Outdoor/Scripts/wooden_bench.gd" id="1_nv27i"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nv27i"]
|
||||
size = Vector2(30, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ffqsr"]
|
||||
atlas = ExtResource("1_jlu4v")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jlu4v"]
|
||||
size = Vector2(30, 8)
|
||||
|
||||
[node name="Wooden Bench" type="StaticBody2D" unique_id=134763703]
|
||||
y_sort_enabled = true
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_nv27i")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1606779105]
|
||||
position = Vector2(0, 3.5)
|
||||
shape = SubResource("RectangleShape2D_nv27i")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=277583581]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 5)
|
||||
texture = SubResource("AtlasTexture_ffqsr")
|
||||
offset = Vector2(0, -5)
|
||||
|
||||
[node name="Sitting Spots" type="Node2D" parent="." unique_id=1579486993]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Sitting Spots" unique_id=1705252915]
|
||||
position = Vector2(-9, 0)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Sitting Spots" unique_id=1990058096]
|
||||
position = Vector2(9, 0)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Sitting Spots" unique_id=1451254051]
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=1791036565]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=1358423659]
|
||||
position = Vector2(0, 2)
|
||||
shape = SubResource("RectangleShape2D_jlu4v")
|
||||
debug_color = Color(0.991744, 0, 0.26762646, 0.41960785)
|
||||
23
Entities/Map Objects/Decorative/Signs/wooden_sign_01.tscn
Normal file
23
Entities/Map Objects/Decorative/Signs/wooden_sign_01.tscn
Normal file
@@ -0,0 +1,23 @@
|
||||
[gd_scene format=3 uid="uid://dwbg6wca6yl5j"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://fsdihflna5x8" path="res://Assets/Spritesheets/Outdoor Decor/Signs.png" id="1_i0umk"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_mo7c5"]
|
||||
radius = 4.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3a56g"]
|
||||
atlas = ExtResource("1_i0umk")
|
||||
region = Rect2(0, 144, 32, 48)
|
||||
|
||||
[node name="Wooden Sign 01" type="StaticBody2D" unique_id=940755730]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1879872203]
|
||||
position = Vector2(7, 20)
|
||||
shape = SubResource("CircleShape2D_mo7c5")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=824773966]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 22)
|
||||
texture = SubResource("AtlasTexture_3a56g")
|
||||
offset = Vector2(0, -22)
|
||||
24
Entities/Map Objects/Decorative/Signs/wooden_sign_02.tscn
Normal file
24
Entities/Map Objects/Decorative/Signs/wooden_sign_02.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene format=3 uid="uid://coaf2ndwb6h61"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://fsdihflna5x8" path="res://Assets/Spritesheets/Outdoor Decor/Signs.png" id="1_7fm5q"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7fm5q"]
|
||||
size = Vector2(4, 4)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_83w4c"]
|
||||
atlas = ExtResource("1_7fm5q")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[node name="Wooden Sign 02" type="StaticBody2D" unique_id=1825670645]
|
||||
y_sort_enabled = true
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1251542595]
|
||||
position = Vector2(0, 5)
|
||||
shape = SubResource("RectangleShape2D_7fm5q")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=679110181]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 7)
|
||||
texture = SubResource("AtlasTexture_83w4c")
|
||||
offset = Vector2(0, -7)
|
||||
10
Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd
Normal file
10
Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Area2D
|
||||
class_name DialogueTrigger
|
||||
|
||||
signal DialogueTriggered(dialogue_name: String)
|
||||
|
||||
@export var dialogue_name: String
|
||||
|
||||
# Public Methods
|
||||
func Trigger() -> void:
|
||||
DialogueTriggered.emit(dialogue_name)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cfsfx0sahh5t7
|
||||
8
Entities/Map Objects/Dialogue/dialogue_trigger.tscn
Normal file
8
Entities/Map Objects/Dialogue/dialogue_trigger.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://b60nr4wfvijpf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cfsfx0sahh5t7" path="res://Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd" id="1_dyjvr"]
|
||||
|
||||
[node name="Dialogue Trigger" type="Area2D" unique_id=189867444 groups=["Dialog Trigger Group"]]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_dyjvr")
|
||||
22
Entities/Map Objects/Entity Spawners/arrow_spawner.gd
Normal file
22
Entities/Map Objects/Entity Spawners/arrow_spawner.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends Node
|
||||
|
||||
# Exports
|
||||
@export var player: PlayerCharacter
|
||||
@export var arrow_parent: Node2D
|
||||
|
||||
# Preloads
|
||||
const wooden_arrow_scene: PackedScene = preload("uid://b2wq5m01b68rx")
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
var firing_arrow_state: FiringArrowState = player.get_node("State Machine/States/Firing Arrow State")
|
||||
firing_arrow_state.ArrowFired.connect(_on_arrow_fired)
|
||||
|
||||
|
||||
func _on_arrow_fired(fire_position: Vector2, direction: Vector2) -> void:
|
||||
var wooden_arrow := wooden_arrow_scene.instantiate() as BaseProjectile
|
||||
wooden_arrow.SetProjectileStartAndDirection(fire_position, direction)
|
||||
|
||||
if arrow_parent == null:
|
||||
return
|
||||
arrow_parent.add_child(wooden_arrow)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dvgd5ejerauqm
|
||||
17
Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd
Normal file
17
Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends StaticBody2D
|
||||
|
||||
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||
@onready var collision_shape_2d: CollisionShape2D = $CollisionShape2D
|
||||
|
||||
var is_open := false
|
||||
|
||||
func OpenGate() -> void:
|
||||
if is_open:
|
||||
return
|
||||
is_open = true
|
||||
|
||||
sprite.play("opening")
|
||||
await sprite.animation_finished
|
||||
|
||||
collision_shape_2d.set_deferred("disabled", true)
|
||||
sprite.play("open")
|
||||
@@ -0,0 +1 @@
|
||||
uid://8erg53skow38
|
||||
400
Entities/Map Objects/Gates/Spike Gate/spike_gate.tscn
Normal file
400
Entities/Map Objects/Gates/Spike Gate/spike_gate.tscn
Normal file
@@ -0,0 +1,400 @@
|
||||
[gd_scene format=3 uid="uid://da4qqruhldc6b"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://1kmd0qww3368" path="res://Assets/Spritesheets/Outdoor Objects/Spike_Gate_anim.png" id="1_5ttkm"]
|
||||
[ext_resource type="Script" uid="uid://8erg53skow38" path="res://Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd" id="1_kye8r"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5ttkm"]
|
||||
size = Vector2(29, 4)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kye8r"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rnxg7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1536, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5ttkm"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pki7h"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lvs8d"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(64, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_40kpl"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(96, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ms1vp"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tvc1a"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(160, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vy5ys"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(192, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u2ylj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(224, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gjiar"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(256, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1dqry"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(288, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jck8c"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(320, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5xkn8"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(352, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iv6vj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(384, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i530s"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(416, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d6ylt"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(448, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xtjjs"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(480, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ci8mo"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(512, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gmmov"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(544, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vfoxu"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(576, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ho6i7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(608, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iubls"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(640, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m3ksf"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(672, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0822b"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(704, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_52ayd"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(736, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q0cp4"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(768, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bjex2"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(800, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sa64n"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(832, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnpnr"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(864, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_edpr7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(896, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n1dnq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(928, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_oeoqj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(960, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t83ji"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(992, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_x467m"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1024, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6y5l3"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1056, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dxjpb"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1088, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dnpsp"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1120, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u3fxw"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1152, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pq5cv"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1184, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_03fuj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1216, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qtdja"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1248, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gpmon"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1280, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dt18d"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1312, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mvctv"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1344, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m214n"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1376, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r1uqq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1408, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c1gm7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1440, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ab08u"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1472, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r3qcl"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1504, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_osvbq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1536, 0, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_pki7h"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kye8r")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rnxg7")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"open",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5ttkm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pki7h")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_lvs8d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_40kpl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ms1vp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tvc1a")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vy5ys")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u2ylj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gjiar")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1dqry")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jck8c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5xkn8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_iv6vj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i530s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d6ylt")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xtjjs")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ci8mo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gmmov")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vfoxu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ho6i7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_iubls")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m3ksf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0822b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_52ayd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q0cp4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bjex2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sa64n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wnpnr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_edpr7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_n1dnq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_oeoqj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t83ji")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_x467m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6y5l3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dxjpb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dnpsp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u3fxw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pq5cv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_03fuj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qtdja")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gpmon")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dt18d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mvctv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m214n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_r1uqq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c1gm7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ab08u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_r3qcl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_osvbq")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 20.0
|
||||
}]
|
||||
|
||||
[node name="Spike Gate" type="StaticBody2D" unique_id=1020421430]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 5
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_kye8r")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=522352776]
|
||||
position = Vector2(0.5, 13)
|
||||
shape = SubResource("RectangleShape2D_5ttkm")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1790681326]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 15)
|
||||
sprite_frames = SubResource("SpriteFrames_pki7h")
|
||||
animation = &"closed"
|
||||
autoplay = "closed"
|
||||
offset = Vector2(0, -15)
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
class_name CollisionLoadingZone
|
||||
|
||||
@export var loading_zone_transporter: LoadingZoneTransporter
|
||||
|
||||
# Private Methods
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is not PlayerCharacter:
|
||||
return
|
||||
|
||||
loading_zone_transporter.Activate()
|
||||
@@ -0,0 +1 @@
|
||||
uid://ckfuj0lm6jv3i
|
||||
@@ -0,0 +1,8 @@
|
||||
extends Area2D
|
||||
class_name InteractiveLoadingZone
|
||||
|
||||
@export var loading_zone_transporter: LoadingZoneTransporter
|
||||
|
||||
# Public Methods
|
||||
func Activate() -> void:
|
||||
loading_zone_transporter.Activate()
|
||||
@@ -0,0 +1 @@
|
||||
uid://csspyy43sohfl
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Node
|
||||
class_name LoadingZoneTransporter
|
||||
|
||||
signal MapTransitionQueued(map_id: Enums.MapIds, marker_name: String)
|
||||
|
||||
@export var destination_map_id: Enums.MapIds
|
||||
@export var destination_marker_name: String
|
||||
|
||||
var _packed_scene: PackedScene
|
||||
|
||||
# Public Methods
|
||||
func Activate() -> void:
|
||||
MapTransitionQueued.emit(destination_map_id, destination_marker_name)
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
_packed_scene = MapLoader.GetMap(destination_map_id)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bvl1vdqd5cjkc
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://ca75b65eh7vv8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ckfuj0lm6jv3i" path="res://Entities/Map Objects/Loading Zone/Scripts/collision_loading_zone.gd" id="1_pb5hg"]
|
||||
|
||||
[node name="Collision Loading Zone" type="Area2D" unique_id=1043800735 groups=["Collision Loading Zone Group"]]
|
||||
collision_layer = 0
|
||||
script = ExtResource("1_pb5hg")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://cla2d3gii8qda"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csspyy43sohfl" path="res://Entities/Map Objects/Loading Zone/Scripts/interactive_loading_zone.gd" id="1_7bdbd"]
|
||||
|
||||
[node name="Interactive Loading Zone" type="Area2D" unique_id=1427014981 groups=["Interactive Loading Zone Group"]]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_7bdbd")
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://bbules4o3xayc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvl1vdqd5cjkc" path="res://Entities/Map Objects/Loading Zone/Scripts/loading_zone_transporter.gd" id="1_p8o2m"]
|
||||
|
||||
[node name="Loading Zone Transporter" type="Node" unique_id=1690817663 groups=["Loading Zone Transporter Group"]]
|
||||
script = ExtResource("1_p8o2m")
|
||||
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Area2D
|
||||
|
||||
signal TargetHit
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is not CharacterBody2D:
|
||||
return
|
||||
TargetHit.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://6jls1eokv2to
|
||||
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Area2D
|
||||
|
||||
signal PressurePlateTripped
|
||||
|
||||
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
var activated := false
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if activated:
|
||||
return
|
||||
|
||||
activated = true
|
||||
animated_sprite_2d.play("activated")
|
||||
PressurePlateTripped.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://cxt7ht66jiac8
|
||||
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends Area2D
|
||||
class_name ShopItem
|
||||
|
||||
@export var check_location: Enums.CheckLocations
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cggyjxrk4qqfm
|
||||
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
@@ -0,0 +1,53 @@
|
||||
[gd_scene format=3 uid="uid://b8m08wroe1qu2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://k2htcxstdj5v" path="res://Assets/Spritesheets/Outdoor Objects/Arrow Target-Sheet.png" id="1_b0s8y"]
|
||||
[ext_resource type="Script" uid="uid://6jls1eokv2to" path="res://Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd" id="1_uhut5"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_uhut5"]
|
||||
radius = 8.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b0s8y"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uhut5"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_bfwsr"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b0s8y")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"hit",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uhut5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"unhit",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="ArrowTarget" type="Area2D" unique_id=1856751990]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_uhut5")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=522196069]
|
||||
shape = SubResource("CircleShape2D_uhut5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1145493202]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 8)
|
||||
sprite_frames = SubResource("SpriteFrames_bfwsr")
|
||||
animation = &"unhit"
|
||||
autoplay = "unhit"
|
||||
offset = Vector2(0, -8)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene format=3 uid="uid://b5t4h63xhuods"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cxt7ht66jiac8" path="res://Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd" id="1_po2h8"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhtolttw5h33" path="res://Assets/Spritesheets/Mechanisms/Pressure Plate.png" id="1_ulio5"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ulio5"]
|
||||
size = Vector2(12, 10)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ulio5"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_po2h8"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_50pip"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ulio5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"activated",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_po2h8")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="PressurePlate" type="Area2D" unique_id=1213720400]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 0
|
||||
script = ExtResource("1_po2h8")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=180813085]
|
||||
position = Vector2(0, -1)
|
||||
shape = SubResource("RectangleShape2D_ulio5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=3182720]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, -7)
|
||||
sprite_frames = SubResource("SpriteFrames_50pip")
|
||||
autoplay = "default"
|
||||
offset = Vector2(0, 7)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://ddgeo3vwebqeg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cggyjxrk4qqfm" path="res://Entities/Map Objects/Mechanisms/Scripts/shop_item.gd" id="1_0luup"]
|
||||
|
||||
[node name="ShopItem" type="Area2D" unique_id=1768344009]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_0luup")
|
||||
78
Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd
Normal file
78
Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd
Normal file
@@ -0,0 +1,78 @@
|
||||
extends Node2D
|
||||
|
||||
@export var leaf_texture: Texture2D
|
||||
@export var spawn_markers: Node2D
|
||||
@export var destination_markers: Node2D
|
||||
|
||||
@export_range(0.0, 60.0) var minimum_schedule_gap := 20.0
|
||||
@export_range(1.0, 61.0) var maximum_schedule_gap := 60.0
|
||||
|
||||
var _spawn_markers: Array[Marker2D] = []
|
||||
var _destination_markers: Array[Marker2D] = []
|
||||
var _spawn_schedule := 0.0
|
||||
var _spawn_timer := 0.0
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
for child in spawn_markers.get_children():
|
||||
_spawn_markers.append(child)
|
||||
|
||||
for child in destination_markers.get_children():
|
||||
_destination_markers.append(child)
|
||||
|
||||
_set_random_spawn_schedule()
|
||||
|
||||
# At spawn, we might want to spawn some leaves sooner...
|
||||
_spawn_schedule -= randf_range(0.0, _spawn_schedule)
|
||||
_spawn_schedule = max(0, _spawn_schedule)
|
||||
print("%s - Leaf Spawn Schedule: %f" % [get_parent().name, _spawn_schedule])
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_spawn_timer += delta
|
||||
if _spawn_timer >= _spawn_schedule:
|
||||
_spawn_timer = 0.0
|
||||
_set_random_spawn_schedule()
|
||||
|
||||
var spawn := _get_random_spawn_point()
|
||||
var destination := _get_random_destination_point()
|
||||
|
||||
# TODO Refactor this into scene
|
||||
var sprite := Sprite2D.new()
|
||||
sprite.texture = leaf_texture
|
||||
sprite.position = spawn
|
||||
sprite.rotate(deg_to_rad(randf_range(0, 360)))
|
||||
var tween := get_tree().create_tween().tween_property(sprite, "position", destination, randf_range(2.0, 3.0))
|
||||
tween.finished.connect(
|
||||
func():
|
||||
var timer := get_tree().create_timer(randf_range(8.0, 15.0))
|
||||
timer.timeout.connect(
|
||||
func():
|
||||
if !sprite: return
|
||||
var tween2 := get_tree().create_tween().tween_property(sprite, "self_modulate:a", 0.0, randf_range(4.0, 6.0))
|
||||
tween2.finished.connect(
|
||||
func():
|
||||
if !sprite: return
|
||||
sprite.queue_free()
|
||||
)
|
||||
)
|
||||
)
|
||||
add_child(sprite)
|
||||
|
||||
|
||||
func _set_random_spawn_schedule() -> void:
|
||||
_spawn_schedule = randf_range(minimum_schedule_gap, maximum_schedule_gap)
|
||||
|
||||
|
||||
func _get_random_spawn_point() -> Vector2:
|
||||
var idx := randi_range(0, len(_spawn_markers) - 1)
|
||||
var marker := _spawn_markers[idx]
|
||||
return marker.position
|
||||
|
||||
|
||||
func _get_random_destination_point() -> Vector2:
|
||||
var idx := randi_range(0, len(_destination_markers) - 1)
|
||||
var marker := _destination_markers[idx]
|
||||
var offset := Vector2(randf_range(-5.0, 5.0), randf_range(-5.0, 5.0))
|
||||
|
||||
return marker.position + offset
|
||||
@@ -0,0 +1 @@
|
||||
uid://vmyfl4obus88
|
||||
7
Entities/Map Objects/Trees/Effects/leaf_spawner.tscn
Normal file
7
Entities/Map Objects/Trees/Effects/leaf_spawner.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://dpwm1tn0mbr3l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vmyfl4obus88" path="res://Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd" id="1_l7yxv"]
|
||||
|
||||
[node name="Leaf Spawner" type="Node2D" unique_id=986945632]
|
||||
y_sort_enabled = true
|
||||
script = ExtResource("1_l7yxv")
|
||||
102
Entities/Map Objects/Trees/tree_01.tscn
Normal file
102
Entities/Map Objects/Trees/tree_01.tscn
Normal file
@@ -0,0 +1,102 @@
|
||||
[gd_scene format=3 uid="uid://cc3qat6un2323"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://xygpf7c886pj" path="res://Assets/Spritesheets/Trees/Medium_Oak_Tree.png" id="1_i2ia5"]
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="1_jbed0"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_jbed0"]
|
||||
radius = 12.0
|
||||
|
||||
[sub_resource type="Shader" id="Shader_jbed0"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_o0u4i"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b23hf"]
|
||||
shader = SubResource("Shader_jbed0")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_o0u4i")
|
||||
shader_parameter/amplitude = 0.05999999865888
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5otsd"]
|
||||
atlas = ExtResource("1_i2ia5")
|
||||
region = Rect2(32, 0, 32, 48)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(6, 3)
|
||||
|
||||
[node name="Tree 01" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("1_jbed0")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=731605527]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("CircleShape2D_jbed0")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_b23hf")
|
||||
position = Vector2(0, 8)
|
||||
texture = SubResource("AtlasTexture_5otsd")
|
||||
offset = Vector2(0, -8)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 6.5)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
157
Entities/Map Objects/Trees/tree_02.tscn
Normal file
157
Entities/Map Objects/Trees/tree_02.tscn
Normal file
@@ -0,0 +1,157 @@
|
||||
[gd_scene format=3 uid="uid://be6xfndyj4ckx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="1_ijlg6"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6cddkuevr4hl" path="res://Assets/Spritesheets/Trees/Big_Oak_Tree-Isolated.png" id="2_mxye4"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwm1tn0mbr3l" path="res://Entities/Map Objects/Trees/Effects/leaf_spawner.tscn" id="3_n7ubj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dv2qcpyn2rk5s" path="res://Assets/Spritesheets/Trees/Oak_Leaf_Particle.png" id="4_xq3h5"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ijlg6"]
|
||||
radius = 23.021729
|
||||
|
||||
[sub_resource type="Shader" id="Shader_mxye4"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pv2vp"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ocj51"]
|
||||
shader = SubResource("Shader_mxye4")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_pv2vp")
|
||||
shader_parameter/amplitude = 0.1999999955296
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(16, 10)
|
||||
|
||||
[node name="Tree 02" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("1_ijlg6")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=1085880925]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("CircleShape2D_ijlg6")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_ocj51")
|
||||
position = Vector2(0, 24)
|
||||
texture = ExtResource("2_mxye4")
|
||||
offset = Vector2(0, -24)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 19)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
|
||||
[node name="Leaf Spawner" parent="." unique_id=986945632 node_paths=PackedStringArray("spawn_markers", "destination_markers") instance=ExtResource("3_n7ubj")]
|
||||
leaf_texture = ExtResource("4_xq3h5")
|
||||
spawn_markers = NodePath("Spawn Markers")
|
||||
destination_markers = NodePath("Destination Markers")
|
||||
|
||||
[node name="Spawn Markers" type="Node2D" parent="Leaf Spawner" unique_id=718423149]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=110047229]
|
||||
position = Vector2(-10, -19)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1030089042]
|
||||
position = Vector2(-15, -2)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1530367987]
|
||||
position = Vector2(9, 4)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=2042975279]
|
||||
position = Vector2(15, -10)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=712311756]
|
||||
position = Vector2(8, -24)
|
||||
|
||||
[node name="Destination Markers" type="Node2D" parent="Leaf Spawner" unique_id=1860944141]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=608985314]
|
||||
position = Vector2(-23, 14)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=860056803]
|
||||
position = Vector2(-27, 25)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=457722512]
|
||||
position = Vector2(-15, 21)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1184860371]
|
||||
position = Vector2(-5, 30)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=181196191]
|
||||
position = Vector2(6, 26)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1185929582]
|
||||
position = Vector2(18, 34)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=180258159]
|
||||
position = Vector2(25, 18)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1566992504]
|
||||
position = Vector2(14, 20)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1862213394]
|
||||
position = Vector2(16, 11)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=489682641]
|
||||
position = Vector2(30, 8)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=495586307]
|
||||
position = Vector2(-34, 12)
|
||||
207
Entities/Map Objects/Trees/tree_03.tscn
Normal file
207
Entities/Map Objects/Trees/tree_03.tscn
Normal file
@@ -0,0 +1,207 @@
|
||||
[gd_scene format=3 uid="uid://bcx1d8kvp7o0h"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bhdecga15imvk" path="res://Assets/Spritesheets/Trees/Big_Spruce_tree.png" id="1_xun88"]
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="2_45i4c"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwm1tn0mbr3l" path="res://Entities/Map Objects/Trees/Effects/leaf_spawner.tscn" id="3_nua4y"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckvfo6bl606hp" path="res://Assets/Spritesheets/Trees/Spruce_Needle_Particle.png" id="4_34ibr"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_13veg"]
|
||||
radius = 15.033297
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_34ibr"]
|
||||
radius = 8.0
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bbkr4"]
|
||||
radius = 3.0
|
||||
|
||||
[sub_resource type="Shader" id="Shader_34ibr"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bbkr4"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b4y2c"]
|
||||
shader = SubResource("Shader_34ibr")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_bbkr4")
|
||||
shader_parameter/amplitude = 0.03999999910592
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5otsd"]
|
||||
atlas = ExtResource("1_xun88")
|
||||
region = Rect2(64, 0, 64, 80)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(16, 10)
|
||||
|
||||
[node name="Tree 03" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("2_45i4c")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=585236031]
|
||||
shape = SubResource("CircleShape2D_13veg")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Occlusion Culler" unique_id=1731688944]
|
||||
position = Vector2(0, -18)
|
||||
shape = SubResource("CircleShape2D_34ibr")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Occlusion Culler" unique_id=424659978]
|
||||
position = Vector2(0, -32)
|
||||
shape = SubResource("CircleShape2D_bbkr4")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_b4y2c")
|
||||
position = Vector2(0, 24)
|
||||
texture = SubResource("AtlasTexture_5otsd")
|
||||
offset = Vector2(0, -24)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 19)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
|
||||
[node name="Leaf Spawner" parent="." unique_id=986945632 node_paths=PackedStringArray("spawn_markers", "destination_markers") instance=ExtResource("3_nua4y")]
|
||||
leaf_texture = ExtResource("4_34ibr")
|
||||
spawn_markers = NodePath("Spawn Markers")
|
||||
destination_markers = NodePath("Destination Markers")
|
||||
|
||||
[node name="Spawn Markers" type="Node2D" parent="Leaf Spawner" unique_id=992261793]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1312492144]
|
||||
position = Vector2(-14, 5)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1942462835]
|
||||
position = Vector2(-11, -4)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=810574820]
|
||||
position = Vector2(-7, -15)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=291879085]
|
||||
position = Vector2(-3, -29)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1559139972]
|
||||
position = Vector2(4, -30)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=842452431]
|
||||
position = Vector2(7, -22)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=947896890]
|
||||
position = Vector2(10, -12)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1254697051]
|
||||
position = Vector2(11, 1)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=598463156]
|
||||
position = Vector2(13, 12)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1632041472]
|
||||
position = Vector2(7, 14)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=705248658]
|
||||
position = Vector2(-7, 14)
|
||||
|
||||
[node name="Destination Markers" type="Node2D" parent="Leaf Spawner" unique_id=1084196582]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1434626655]
|
||||
position = Vector2(-17, 19)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1985496050]
|
||||
position = Vector2(-32, 27)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=612599198]
|
||||
position = Vector2(-30, 15)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1750692117]
|
||||
position = Vector2(-19, 33)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1637274691]
|
||||
position = Vector2(-7, 38)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=270534968]
|
||||
position = Vector2(-1, 30)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1580580484]
|
||||
position = Vector2(-8, 27)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1666879158]
|
||||
position = Vector2(14, 38)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=33388155]
|
||||
position = Vector2(12, 30)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1245617655]
|
||||
position = Vector2(24, 25)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=709006321]
|
||||
position = Vector2(19, 20)
|
||||
|
||||
[node name="Marker2D12" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=602455411]
|
||||
position = Vector2(28, 14)
|
||||
|
||||
[node name="Marker2D13" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=264453249]
|
||||
position = Vector2(35, 28)
|
||||
|
||||
[node name="Marker2D14" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=2036567999]
|
||||
position = Vector2(28, 36)
|
||||
|
||||
[node name="Marker2D15" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1663646612]
|
||||
position = Vector2(-26, 34)
|
||||
|
||||
[node name="Marker2D16" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1858656621]
|
||||
position = Vector2(-26, 34)
|
||||
Reference in New Issue
Block a user