Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scenes/game_elements/characters/components/gym_area_test.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
[ext_resource type="SpriteFrames" uid="uid://dnq8cw1cio2we" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_green.tres" id="20_jdub8"]
[ext_resource type="Script" uid="uid://r1kriwyodjlt" path="res://scenes/game_logic/walk_behaviors/navigation_follow_walk_behavior.gd" id="21_jdub8"]
[ext_resource type="PackedScene" uid="uid://dy8ohrl7j24qy" path="res://scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn" id="29_phf8p"]
[ext_resource type="PackedScene" uid="uid://daqd67aro1o1m" path="res://scenes/game_elements/fx/time_and_weather/time_and_weather.tscn" id="30_m10i7"]
[ext_resource type="PackedScene" uid="uid://4u7dloafx55f" path="res://scenes/game_elements/props/teleporter/teleporter/teleporter.tscn" id="31_dxlnp"]

[sub_resource type="NavigationPolygon" id="NavigationPolygon_oojqe"]
vertices = PackedVector2Array(2612.09, 882.242, 1372.27, 799.719, 1388.82, 670.781, 2393.78, 645.758, 2512.78, -340, 2413.06, -200.32, 1470.91, -340, 1455.69, -202.648, -91.9688, -367.812, 1185.81, -149, 214.844, -149, 1448.35, 0.960938, 1188.65, 0.03125, -89.0234, 939, 227.094, 641.859, 380.844, 893.93, 378.094, 727.859)
Expand Down Expand Up @@ -333,6 +335,9 @@ point_count = 11
radius = 6.0
height = 21.9972

[sub_resource type="RectangleShape2D" id="RectangleShape2D_1rbfs"]
size = Vector2(163, 149)

[node name="TestGymArea" type="Node2D" unique_id=1044929244]

[node name="TileMapLayers" type="Node2D" parent="." unique_id=690104550]
Expand Down Expand Up @@ -639,6 +644,17 @@ character = NodePath("..")
position = Vector2(1064, 752)
debug_mode = true

[node name="TimeAndWeather" parent="." unique_id=1446545037 instance=ExtResource("30_m10i7")]

[node name="Teleporter" parent="." unique_id=812046722 instance=ExtResource("31_dxlnp")]
position = Vector2(709, 410)
next_scene = "uid://cufkthb25mpxy"
spawn_point_path = NodePath("SpawnPointAfterIntro")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1590021840]
position = Vector2(7.5, -22.5)
shape = SubResource("RectangleShape2D_1rbfs")

[connection signal="body_entered" from="OnTheGround/CharacterBody2D/Area2D" to="OnTheGround/CharacterBody2D/Area2D" method="_on_body_entered"]
[connection signal="timeout" from="OnTheGround/CharacterBody2D2/Timer" to="OnTheGround/CharacterBody2D2/ThrowProjectileBehavior" method="throw"]
[connection signal="running_changed" from="OnTheGround/CharacterBody2D4/InputWalkBehavior" to="OnTheGround/CharacterBody2D4/GPUParticles2D" method="_on_input_walk_behavior_running_changed"]
Expand Down
14 changes: 14 additions & 0 deletions scenes/game_elements/characters/player/player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
[ext_resource type="Script" uid="uid://b7704hdflt5t8" path="res://scenes/game_elements/characters/player/components/player_hook.gd" id="11_nrnyj"]
[ext_resource type="Texture2D" uid="uid://dxaq5piwxqnht" path="res://scenes/game_elements/characters/player/components/dust.png" id="12_3in67"]
[ext_resource type="PackedScene" uid="uid://b0dehcnfo68j1" path="res://scenes/game_elements/props/hook_control/hook_control.tscn" id="13_ecbbk"]
[ext_resource type="Script" uid="uid://bk52qjv58locq" path="res://scenes/game_logic/artificial_light_behavior.gd" id="16_ecbbk"]
[ext_resource type="Texture2D" uid="uid://b5ooaiyxdrp6a" path="res://scenes/game_elements/components/light_texture_256x256.tres" id="16_tnibl"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_je7p5"]
size = Vector2(32, 47)
Expand Down Expand Up @@ -650,3 +652,15 @@ stream = ExtResource("11_blfj0")
volume_db = -5.0
pitch_scale = 7.0
bus = &"SFX"

[node name="PointLight2D" type="PointLight2D" parent="." unique_id=460659966 groups=["night-lights"]]
visibility_layer = 2
scale = Vector2(4, 3)
enabled = false
energy = 0.5
texture = ExtResource("16_tnibl")

[node name="ArtificialLightBehavior" type="Node" parent="PointLight2D" unique_id=789625383 node_paths=PackedStringArray("light")]
script = ExtResource("16_ecbbk")
light = NodePath("..")
metadata/_custom_type_script = "uid://bk52qjv58locq"
15 changes: 15 additions & 0 deletions scenes/game_elements/components/light_texture_256x256.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="GradientTexture2D" format=3 uid="uid://b5ooaiyxdrp6a"]

[sub_resource type="Gradient" id="Gradient_5j6h7"]
interpolation_mode = 2
interpolation_color_space = 2
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)

[resource]
gradient = SubResource("Gradient_5j6h7")
width = 256
height = 256
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0, 0.5)
metadata/_snap_enabled = true
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extends Parallax2D

var texture: NoiseTexture2D
var noise: FastNoiseLite
var tween: Tween

@onready var color_rect: ColorRect = %ColorRect

Expand All @@ -29,3 +30,22 @@ func _ready() -> void:

func randomize() -> void:
await _set_seed(randi())


func fade_in(duration: float = 1) -> void:
if tween:
tween.kill()
color_rect.modulate = Color.BLACK
visible = true
tween = create_tween()
tween.tween_property(color_rect, "modulate", Color.WHITE, duration)
await tween.finished


func fade_out(duration: float = 1) -> void:
if tween:
tween.kill()
tween = create_tween()
tween.tween_property(color_rect, "modulate", Color.BLACK, duration)
await tween.finished
visible = false
20 changes: 20 additions & 0 deletions scenes/game_elements/fx/fog/components/fog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extends Parallax2D

var texture: NoiseTexture2D
var noise: FastNoiseLite
var tween: Tween

@onready var color_rect: ColorRect = %ColorRect

Expand All @@ -29,3 +30,22 @@ func _ready() -> void:

func randomize() -> void:
await _set_seed(randi())


func fade_in(duration: float = 1) -> void:
if tween:
tween.kill()
color_rect.modulate = Color.TRANSPARENT
visible = true
tween = create_tween()
tween.tween_property(color_rect, "modulate:a", 1.0, duration)
await tween.finished


func fade_out(duration: float = 1) -> void:
if tween:
tween.kill()
tween = create_tween()
tween.tween_property(color_rect, "modulate:a", 0.0, duration)
await tween.finished
visible = false
18 changes: 18 additions & 0 deletions scenes/game_elements/fx/rain/components/rain.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends CanvasLayer

@onready var gpu_particles_2d: GPUParticles2D = %GPUParticles2D


func randomize() -> void:
var rain_type := randf()
if rain_type < 0.25:
# 25% chances of having a drizzle.
gpu_particles_2d.amount_ratio = randf_range(0, 0.1)
elif rain_type >= 0.75:
# 25% chances of having a steady rain.
gpu_particles_2d.amount_ratio = randf_range(0.8, 1)
else:
# 50% chances of having something in between.
gpu_particles_2d.amount_ratio = randf_range(0.1, 0.8)
1 change: 1 addition & 0 deletions scenes/game_elements/fx/rain/components/rain.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cj6sjml7vpydg
69 changes: 69 additions & 0 deletions scenes/game_elements/fx/rain/rain.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[gd_scene format=3 uid="uid://hcmrrtp62iue"]

[ext_resource type="Script" uid="uid://cj6sjml7vpydg" path="res://scenes/game_elements/fx/rain/components/rain.gd" id="1_63sw3"]

[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_r1ek1"]
blend_mode = 1

[sub_resource type="Gradient" id="Gradient_duxxr"]

[sub_resource type="GradientTexture2D" id="GradientTexture2D_2vvub"]
gradient = SubResource("Gradient_duxxr")
width = 1
height = 10
fill_to = Vector2(0.042735044, 1)

[sub_resource type="Curve" id="Curve_r1ek1"]
_data = [Vector2(0, 0.23757458), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2

[sub_resource type="CurveTexture" id="CurveTexture_ns5r3"]
curve = SubResource("Curve_r1ek1")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_r1ek1"]
particle_flag_disable_z = true
emission_shape_offset = Vector3(1280, 0, 0)
emission_shape = 3
emission_box_extents = Vector3(1280, 1, 1)
direction = Vector3(0, 1, 0)
spread = 0.0
initial_velocity_min = 100.0
initial_velocity_max = 1000.0
gravity = Vector3(0, 98, 0)
scale_max = 5.0
scale_over_velocity_max = 1000.0
scale_over_velocity_curve = SubResource("CurveTexture_ns5r3")

[sub_resource type="GDScript" id="GDScript_2vvub"]
script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends GPUParticles2D


func randomize() -> void:
var rain_type := randf()
if rain_type < 0.25:
# 25% chances of having a drizzle.
amount_ratio = randf_range(0, 0.1)
elif rain_type >= 0.75:
# 25% chances of having a steady rain.
amount_ratio = randf_range(0.8, 1)
else:
# 50% chances of having something in between.
amount_ratio = randf_range(0.1, 0.8)
"

[node name="Rain" type="CanvasLayer" unique_id=1558838625]
script = ExtResource("1_63sw3")

[node name="GPUParticles2D" type="GPUParticles2D" parent="." unique_id=1757968667]
unique_name_in_owner = true
modulate = Color(0.3575, 0.44733334, 0.55, 1)
material = SubResource("CanvasItemMaterial_r1ek1")
emitting = false
amount = 500
texture = SubResource("GradientTexture2D_2vvub")
lifetime = 0.81
speed_scale = 2.0
process_material = SubResource("ParticleProcessMaterial_r1ek1")
script = SubResource("GDScript_2vvub")
Loading
Loading