beta-1.3/restructure-files #2

Merged
cgandeg merged 3 commits from beta-1.3/restructure-files into main 2026-03-17 13:45:35 -06:00
156 changed files with 369 additions and 163 deletions

3
.gitignore vendored
View File

@@ -17,3 +17,6 @@ mono_crash.*.json
# Android build files
/android/
# Rider files
.idea

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://clqfyxjtn67m"]
[ext_resource type="Script" uid="uid://c5pt6iroi01si" path="res://Scripts/Characters/Chicken/npc_chicken.gd" id="1_etrql"]
[ext_resource type="Script" uid="uid://c5pt6iroi01si" path="res://Entities/Characters/Animals/Chicken/Scripts/npc_chicken.gd" id="1_etrql"]
[ext_resource type="Texture2D" uid="uid://d4lf74neoqf4p" path="res://Assets/Spritesheets/Animals/Chickens/Chicken_01.png" id="1_hjr72"]
[sub_resource type="AtlasTexture" id="AtlasTexture_etrql"]

View File

@@ -1,19 +1,19 @@
[gd_scene format=3 uid="uid://6athlweutl2g"]
[ext_resource type="PackedScene" uid="uid://uyl0s1e67x6s" path="res://Scenes/Characters/Player/sprite.tscn" id="1_27cb7"]
[ext_resource type="PackedScene" uid="uid://c2ydbmmvnfca6" path="res://Scenes/Characters/Player/state_machine.tscn" id="1_lyjr2"]
[ext_resource type="Script" uid="uid://dacvayqstkvws" path="res://Scripts/Characters/Player/player.gd" id="1_qqvsf"]
[ext_resource type="PackedScene" uid="uid://uyl0s1e67x6s" path="res://Entities/Characters/Player/sprite.tscn" id="1_27cb7"]
[ext_resource type="PackedScene" uid="uid://c2ydbmmvnfca6" path="res://Entities/Characters/Player/state_machine.tscn" id="1_lyjr2"]
[ext_resource type="Script" uid="uid://dacvayqstkvws" path="res://Entities/Characters/Player/Scripts/player.gd" id="1_qqvsf"]
[ext_resource type="Script" uid="uid://b0l02v61if6k8" path="res://Scripts/Components/facing_direction_component.gd" id="1_siygm"]
[ext_resource type="Script" uid="uid://dwclkwbig1uii" path="res://Scripts/Characters/Player/movement_component.gd" id="4_apx8m"]
[ext_resource type="Script" uid="uid://dkmc1t43gomdb" path="res://Scripts/Characters/Player/States/idle_state.gd" id="4_dxcao"]
[ext_resource type="Script" uid="uid://ckn7gmtc23b8l" path="res://Scripts/Characters/Player/States/using_item_a_state.gd" id="5_1mdwi"]
[ext_resource type="Script" uid="uid://bwmmah30t3m0u" path="res://Scripts/Characters/Player/States/walking_state.gd" id="5_cscr0"]
[ext_resource type="Script" uid="uid://brlisuoocwehh" path="res://Scripts/Characters/Player/interact_scanner.gd" id="6_fu1fx"]
[ext_resource type="Script" uid="uid://bnp1vowmu15lg" path="res://Scripts/Characters/Player/States/drawing_bow_state.gd" id="7_cscr0"]
[ext_resource type="Script" uid="uid://cd2ewadcm8oi5" path="res://Scripts/Characters/Player/States/firing_arrow_state.gd" id="8_plevq"]
[ext_resource type="Script" uid="uid://bx1a35al4yiej" path="res://Scripts/Characters/Player/States/sitting_state.gd" id="9_sdxbo"]
[ext_resource type="Script" uid="uid://bnontuqj3cnom" path="res://Scripts/Characters/Player/States/cutscene_state.gd" id="10_p06rw"]
[ext_resource type="Script" uid="uid://wfdtd3xlgrvm" path="res://Scripts/Characters/Player/States/play_animation_state.gd" id="12_aencf"]
[ext_resource type="Script" uid="uid://dwclkwbig1uii" path="res://Entities/Characters/Player/Scripts/movement_component.gd" id="4_apx8m"]
[ext_resource type="Script" uid="uid://dkmc1t43gomdb" path="res://Entities/Characters/Player/Scripts/States/idle_state.gd" id="4_dxcao"]
[ext_resource type="Script" uid="uid://ckn7gmtc23b8l" path="res://Entities/Characters/Player/Scripts/States/using_item_a_state.gd" id="5_1mdwi"]
[ext_resource type="Script" uid="uid://bwmmah30t3m0u" path="res://Entities/Characters/Player/Scripts/States/walking_state.gd" id="5_cscr0"]
[ext_resource type="Script" uid="uid://brlisuoocwehh" path="res://Entities/Characters/Player/Scripts/interact_scanner.gd" id="6_fu1fx"]
[ext_resource type="Script" uid="uid://bnp1vowmu15lg" path="res://Entities/Characters/Player/Scripts/States/drawing_bow_state.gd" id="7_cscr0"]
[ext_resource type="Script" uid="uid://cd2ewadcm8oi5" path="res://Entities/Characters/Player/Scripts/States/firing_arrow_state.gd" id="8_plevq"]
[ext_resource type="Script" uid="uid://bx1a35al4yiej" path="res://Entities/Characters/Player/Scripts/States/sitting_state.gd" id="9_sdxbo"]
[ext_resource type="Script" uid="uid://bnontuqj3cnom" path="res://Entities/Characters/Player/Scripts/States/cutscene_state.gd" id="10_p06rw"]
[ext_resource type="Script" uid="uid://wfdtd3xlgrvm" path="res://Entities/Characters/Player/Scripts/States/play_animation_state.gd" id="12_aencf"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_apx8m"]
size = Vector2(10, 5)

View File

@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://uyl0s1e67x6s"]
[ext_resource type="Texture2D" uid="uid://de0ihg453ruyi" path="res://Assets/Spritesheets/Player/Player_Base_animations.png" id="1_45g06"]
[ext_resource type="Script" uid="uid://cuar23q48cbja" path="res://Scripts/Characters/Player/sprite.gd" id="1_jqxwg"]
[ext_resource type="Script" uid="uid://cuar23q48cbja" path="res://Entities/Characters/Player/Scripts/sprite.gd" id="1_jqxwg"]
[ext_resource type="Texture2D" uid="uid://1g5dx0dbupwk" path="res://Assets/Spritesheets/Player/Hair_1_Blonde.png" id="2_jqxwg"]
[ext_resource type="Texture2D" uid="uid://d1mourl3rq437" path="res://Assets/Spritesheets/Player/player-full-01.png" id="2_ndjja"]
[ext_resource type="Texture2D" uid="uid://4mpha6wuvyfy" path="res://Assets/Spritesheets/Player/Farmer_Shirt_1_Black.png" id="3_ndjja"]

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://c2ydbmmvnfca6"]
[ext_resource type="Script" uid="uid://c74mhfemxuuco" path="res://Scripts/Characters/Player/state_machine.gd" id="1_clu2m"]
[ext_resource type="Script" uid="uid://c74mhfemxuuco" path="res://Entities/Characters/Player/Scripts/state_machine.gd" id="1_clu2m"]
[node name="StateMachine" type="Node" unique_id=732559774]
script = ExtResource("1_clu2m")

View File

@@ -0,0 +1 @@
uid://ba0nsd76er3xa

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://d24gcv3umq60k"]
[ext_resource type="Script" uid="uid://d4g6s63d0bh4o" path="res://Scripts/Objects/Occlusion/occlusion_culler.gd" id="1_4550i"]
[ext_resource type="Script" uid="uid://ba0nsd76er3xa" path="res://Entities/Characters/Utility/Occlusion/Scripts/occlusion_culler.gd" id="1_4550i"]
[node name="Occlusion Culler" type="Area2D" unique_id=1362480066]
collision_layer = 0

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://cd3iyspcdg8m"]
[ext_resource type="Script" uid="uid://0fsmtp1umvmp" path="res://Scripts/Objects/Chests/Bases/chest_base.gd" id="1_6u2sl"]
[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

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://cncm0c4dmosgs"]
[ext_resource type="Script" uid="uid://dbuc0f87m24xf" path="res://Scripts/Objects/Chests/Bases/item_chest.gd" id="1_mkt0u"]
[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")

View File

@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://byp273amg5ji8"]
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Scripts/Objects/Chests/item_chest_01.gd" id="1_lp0kr"]
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Scenes/Animated Sprites/chest01_sprite.tscn" id="2_iwcc8"]
[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"]

View File

@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://b7u4hlvuqiefn"]
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Scripts/Objects/Chests/item_chest_01.gd" id="1_77oue"]
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Scenes/Animated Sprites/chest01_sprite.tscn" id="2_jpeii"]
[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"]

View File

@@ -1,7 +1,7 @@
[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://Scripts/Objects/Decorative/Outdoor/wooden_bench.gd" id="1_nv27i"]
[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)

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://b60nr4wfvijpf"]
[ext_resource type="Script" uid="uid://cfsfx0sahh5t7" path="res://Scripts/Objects/Dialogue/dialogue_trigger.gd" id="1_dyjvr"]
[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

View File

@@ -1,7 +1,7 @@
[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://Scripts/Objects/Gates/Spike Gate/spike_gate.gd" id="1_kye8r"]
[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)

View File

@@ -0,0 +1 @@
uid://ckfuj0lm6jv3i

View File

@@ -0,0 +1 @@
uid://csspyy43sohfl

View File

@@ -0,0 +1 @@
uid://bvl1vdqd5cjkc

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://ca75b65eh7vv8"]
[ext_resource type="Script" uid="uid://g0r5waf50gp5" path="res://Scripts/Objects/Loading Zone/collision_loading_zone.gd" id="1_pb5hg"]
[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

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://cla2d3gii8qda"]
[ext_resource type="Script" uid="uid://dla7fe0nsbdvv" path="res://Scripts/Objects/Loading Zone/interactive_loading_zone.gd" id="1_7bdbd"]
[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

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://bbules4o3xayc"]
[ext_resource type="Script" uid="uid://cshtpe5n2iubh" path="res://Scripts/Objects/Loading Zone/loading_zone_transporter.gd" id="1_p8o2m"]
[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")

View File

@@ -1,7 +1,7 @@
[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://Scripts/Objects/arrow_target.gd" id="1_uhut5"]
[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

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://b5t4h63xhuods"]
[ext_resource type="Script" uid="uid://cxt7ht66jiac8" path="res://Scripts/Objects/Mechanisms/pressure_plate.gd" id="1_po2h8"]
[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"]

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://ddgeo3vwebqeg"]
[ext_resource type="Script" uid="uid://cggyjxrk4qqfm" path="res://Scripts/Objects/shop_item.gd" id="1_0luup"]
[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

View File

@@ -4,6 +4,9 @@ extends Node2D
@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
@@ -20,12 +23,9 @@ func _ready() -> void:
_set_random_spawn_schedule()
# At spawn, we might want to spawn some leaves sooner...
_spawn_schedule -= randf_range(0.0, 15.0)
_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])
# Debug
_spawn_schedule = randf_range(1.0, 3.0)
func _process(delta: float) -> void:
@@ -61,7 +61,7 @@ func _process(delta: float) -> void:
func _set_random_spawn_schedule() -> void:
_spawn_schedule = randf_range(20.0, 60.0)
_spawn_schedule = randf_range(minimum_schedule_gap, maximum_schedule_gap)
func _get_random_spawn_point() -> Vector2:

View 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")

View 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")

View File

@@ -1,19 +1,83 @@
[gd_scene format=3 uid="uid://be6xfndyj4ckx"]
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Scenes/Objects/Occlusion/occlusion_culler.tscn" id="1_ijlg6"]
[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="Material" uid="uid://1shsptwu7rdt" path="res://Resources/Materials/tree_sway.tres" id="2_pv2vp"]
[ext_resource type="Script" uid="uid://vmyfl4obus88" path="res://Scripts/Objects/Trees/leaf_spawner.gd" id="3_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)
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_mxye4"]
load_path = "res://.godot/imported/Oak_Leaf_Particle.png-90b4e62cf0b626a461440019d7b31cd8.ctex"
[node name="Tree 02" type="StaticBody2D" unique_id=2046930104]
y_sort_enabled = true
@@ -26,7 +90,7 @@ shape = SubResource("CircleShape2D_ijlg6")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
y_sort_enabled = true
material = ExtResource("2_pv2vp")
material = SubResource("ShaderMaterial_ocj51")
position = Vector2(0, 24)
texture = ExtResource("2_mxye4")
offset = Vector2(0, -24)
@@ -35,10 +99,8 @@ offset = Vector2(0, -24)
position = Vector2(0, 19)
shape = SubResource("RectangleShape2D_0srx6")
[node name="Leaf Spawner" type="Node2D" parent="." unique_id=1908114650 node_paths=PackedStringArray("spawn_markers", "destination_markers")]
y_sort_enabled = true
script = ExtResource("3_mxye4")
leaf_texture = SubResource("CompressedTexture2D_mxye4")
[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")

View File

@@ -1,9 +1,8 @@
[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://Scenes/Objects/Occlusion/occlusion_culler.tscn" id="2_45i4c"]
[ext_resource type="Material" uid="uid://1shsptwu7rdt" path="res://Resources/Materials/tree_sway.tres" id="2_bbkr4"]
[ext_resource type="Script" uid="uid://vmyfl4obus88" path="res://Scripts/Objects/Trees/leaf_spawner.gd" id="3_13veg"]
[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"]
@@ -15,6 +14,73 @@ 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)
@@ -41,7 +107,7 @@ shape = SubResource("CircleShape2D_bbkr4")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
y_sort_enabled = true
material = ExtResource("2_bbkr4")
material = SubResource("ShaderMaterial_b4y2c")
position = Vector2(0, 24)
texture = SubResource("AtlasTexture_5otsd")
offset = Vector2(0, -24)
@@ -50,8 +116,7 @@ offset = Vector2(0, -24)
position = Vector2(0, 19)
shape = SubResource("RectangleShape2D_0srx6")
[node name="Leaf Spawner" type="Node2D" parent="." unique_id=1308634781 node_paths=PackedStringArray("spawn_markers", "destination_markers")]
script = ExtResource("3_13veg")
[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")

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://bc8u3wlyag7c4"]
[ext_resource type="Script" uid="uid://8q26ldhfyijx" path="res://Scripts/Objects/Weapons/Projectiles/base_projectile.gd" id="1_0qxu7"]
[ext_resource type="Script" uid="uid://8q26ldhfyijx" path="res://Entities/Weapons/Projectiles/Scripts/base_projectile.gd" id="1_0qxu7"]
[node name="BaseProjectile" type="CharacterBody2D" unique_id=647680377]
collision_layer = 0

View File

@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://b2wq5m01b68rx"]
[ext_resource type="Texture2D" uid="uid://hop1gedjh8s4" path="res://Assets/Spritesheets/Player/icons_full_32.png" id="1_0h1c2"]
[ext_resource type="Script" uid="uid://j5yj4piyfql1" path="res://Scripts/Objects/Weapons/Projectiles/wooden_arrow.gd" id="1_44gti"]
[ext_resource type="Script" uid="uid://j5yj4piyfql1" path="res://Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd" id="1_44gti"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0h1c2"]
size = Vector2(10, 2)

Some files were not shown because too many files have changed in this diff Show More