Light2D on sun & moon! ^.^ Clouds now contains BG + cleanup! Candle flame scaling (=

This commit is contained in:
Harmony Honey 2023-03-22 05:10:22 -04:00
parent bbd3bc0b28
commit 461a63a6a0
16 changed files with 194 additions and 52 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Before After
Before After

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(2.08333,0,0,3.84615,-45.8333,-107.692)">
<ellipse cx="46" cy="41" rx="24" ry="13" style="fill:white;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 598 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/circle.svg-902f0a02432b7fd154485a76932a05fb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://media/image/details/circle.svg"
dest_files=[ "res://.import/circle.svg-902f0a02432b7fd154485a76932a05fb.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=5.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/flame.png-80ec48350312dad61dcdde06373285d8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://media/image/details/flame.png"
dest_files=[ "res://.import/flame.png-80ec48350312dad61dcdde06373285d8.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -169,7 +169,6 @@ config/windows_native_icon="res://media/image/icon/rota.ico"
Shared="*res://src/autoload/Shared.tscn"
Cam="*res://src/autoload/Cam.tscn"
UI="*res://src/autoload/UI.tscn"
BG="*res://src/autoload/BG.tscn"
Wipe="*res://src/autoload/Wipe.tscn"
Guide="*res://src/actor/Guide.tscn"
CheatCode="*res://src/autoload/CheatCode.gd"

View file

@ -1,22 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/shader/sky.gdshader" type="Shader" id=1]
[ext_resource path="res://src/autoload/BG.gd" type="Script" id=2]
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 1 )
shader_param/col1 = Color( 1, 0.639216, 0, 1 )
shader_param/col2 = Color( 0, 0.878431, 1, 1 )
[node name="BG" type="CanvasLayer"]
layer = -5
script = ExtResource( 2 )
palette = PoolColorArray( 1, 0.639216, 0, 1, 0, 0.878431, 1, 1, 0, 0.384314, 1, 1, 0.67451, 0, 1, 1, 0.686275, 0, 0.74902, 1, 0, 0, 0, 1 )
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource( 2 )
margin_right = 1280.0
margin_bottom = 720.0
__meta__ = {
"_edit_lock_": true
}

View file

@ -9,19 +9,18 @@ onready var center := $Center
onready var clouds := $Center/Clouds
onready var stars := $Center/Stars
onready var sun := $Center/Stars/Sun
onready var sun_light := $Center/Stars/Sun/Light2D
onready var moon := $Center/Stars/Moon
onready var moon_light := $Center/Stars/Moon/Light2D
onready var night_sky := $Center/Stars/Stars
onready var precip := $Center/Fall
onready var audio_rain := $AudioRain
var precip_list = []
onready var darkness := $Front/ColorRect
onready var bg := $BG
export var cloud_speed := 1.0
export var star_speed := 0.5
var cloud_dir := 1.0
var length = 100.0
var dir := 1.0
var speed_mod := 1.0
var solve_clock := 0.0
var solve_step := 1.0
@ -32,12 +31,14 @@ export var rain_mat : ParticlesMaterial
export var rain_tex : Texture
var sun_frac := 0.5
var moon_frac := 0.5
export var is_rain := false setget set_is_rain
var is_snow := false
var rain_clock := 60.0
export var rain_range := Vector2(60, 240)
export var dry_range := Vector2(60, 720)
var precip_list = []
func _enter_tree():
@ -72,12 +73,20 @@ func scene():
func _physics_process(delta):
clouds.rotate(deg2rad(cloud_speed * delta * cloud_dir))
precip.rotation = clouds.rotation
stars.rotation = BG.frac * TAU
stars.rotation = bg.frac * TAU
sun_frac = ease(abs(bg.frac - 0.5) * 2.0, -7)
moon_frac = 1.0 - sun_frac
sun_frac = ease(abs(BG.frac - 0.5) * 2.0, -7)
sun.modulate.a = sun_frac
moon.modulate.a = 1.0 - sun_frac
night_sky.modulate.a = 1.0 - sun_frac
sun_light.energy = sun_frac * 0.4
sun_light.enabled = sun_frac > 0
moon.modulate.a = moon_frac
moon_light.energy = moon_frac * 0.5
moon_light.enabled = moon_frac > 0
night_sky.modulate.a = moon_frac
darkness.self_modulate.a = moon_frac
rain_clock -= delta
if rain_clock < 0:

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=2]
[gd_scene load_steps=28 format=2]
[ext_resource path="res://src/actor/shape/Circle.gd" type="Script" id=1]
[ext_resource path="res://src/autoload/Clouds.gd" type="Script" id=2]
@ -9,6 +9,9 @@
[ext_resource path="res://media/image/details/circle100.png" type="Texture" id=7]
[ext_resource path="res://media/image/details/star.svg" type="Texture" id=8]
[ext_resource path="res://media/audio/sfx/mixkit-light-rain-looping-1249.wav" type="AudioStream" id=9]
[ext_resource path="res://media/image/details/circle.svg" type="Texture" id=10]
[ext_resource path="res://src/shader/sky.gdshader" type="Shader" id=11]
[ext_resource path="res://src/autoload/BG.gd" type="Script" id=12]
[sub_resource type="Gradient" id=12]
offsets = PoolRealArray( 0, 0.05, 0.95, 1 )
@ -54,10 +57,18 @@ scale_curve = SubResource( 15 )
color = Color( 0, 0.909804, 1, 0.74902 )
color_ramp = SubResource( 11 )
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 11 )
shader_param/col1 = Color( 0, 0.878431, 1, 1 )
shader_param/col2 = Color( 1, 0.639216, 0, 1 )
[sub_resource type="CanvasItemMaterial" id=21]
blend_mode = 2
[sub_resource type="CanvasItemMaterial" id=1]
blend_mode = 1
[sub_resource type="Curve" id=2]
[sub_resource type="Curve" id=22]
_data = [ Vector2( 0, 1 ), 0.0, -0.527273, 0, 1, Vector2( 1, 0.472727 ), -0.527273, 0.0, 1, 0 ]
[sub_resource type="ShaderMaterial" id=4]
@ -101,6 +112,33 @@ rain_mat = SubResource( 17 )
rain_tex = ExtResource( 6 )
is_rain = true
[node name="BG" type="CanvasLayer" parent="."]
layer = -5
script = ExtResource( 12 )
palette = PoolColorArray( 1, 0.639216, 0, 1, 0, 0.878431, 1, 1, 0, 0.384314, 1, 1, 0.67451, 0, 1, 1, 0.686275, 0, 0.74902, 1, 0, 0, 0, 1 )
clock = 190.0
[node name="ColorRect" type="ColorRect" parent="BG"]
material = SubResource( 2 )
margin_right = 1280.0
margin_bottom = 720.0
__meta__ = {
"_edit_lock_": true
}
[node name="Front" type="CanvasLayer" parent="."]
layer = 3
[node name="ColorRect" type="ColorRect" parent="Front"]
modulate = Color( 1, 1, 1, 0.109804 )
material = SubResource( 21 )
margin_right = 1280.0
margin_bottom = 720.0
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
[node name="AudioRain" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
volume_db = 4.0
@ -152,7 +190,7 @@ script = ExtResource( 1 )
[node name="Line2D" type="Line2D" parent="Center/Stars/Sun"]
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -163,7 +201,7 @@ round_precision = 5
rotation = 0.785397
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -174,7 +212,7 @@ round_precision = 5
rotation = 1.57079
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -185,7 +223,7 @@ round_precision = 5
rotation = 2.35619
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -196,7 +234,7 @@ round_precision = 5
rotation = 3.14159
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -207,7 +245,7 @@ round_precision = 5
rotation = 3.92699
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -218,7 +256,7 @@ round_precision = 5
rotation = 4.71238
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
@ -229,13 +267,21 @@ round_precision = 5
rotation = 5.49778
points = PoolVector2Array( 75, 0, 100, 0 )
width = 30.0
width_curve = SubResource( 2 )
width_curve = SubResource( 22 )
default_color = Color( 1, 1, 0, 1 )
joint_mode = 2
begin_cap_mode = 2
end_cap_mode = 2
round_precision = 5
[node name="Light2D" type="Light2D" parent="Center/Stars/Sun"]
texture = ExtResource( 10 )
texture_scale = 20.0
color = Color( 0.996078, 1, 0.909804, 1 )
energy = 0.5
shadow_enabled = true
shadow_gradient_length = 50.0
[node name="Moon" type="Polygon2D" parent="Center/Stars"]
self_modulate = Color( 1, 0.701961, 0, 1 )
material = SubResource( 4 )
@ -248,6 +294,14 @@ polygon = PoolVector2Array( 100, 0, 92.3879, 38.2683, 70.7107, 70.7107, 38.2683,
script = ExtResource( 1 )
radius = 100.0
[node name="Light2D" type="Light2D" parent="Center/Stars/Moon"]
texture = ExtResource( 10 )
texture_scale = 20.0
color = Color( 0.996078, 1, 0.909804, 1 )
energy = 0.5
shadow_enabled = true
shadow_gradient_length = 50.0
[node name="Stars" type="Particles2D" parent="Center/Stars"]
modulate = Color( 1, 1, 1, 0.5 )
material = SubResource( 18 )

View file

@ -46,7 +46,6 @@ func _physics_process(delta):
keys.move(delta)
clock_down.modulate.a = clock_ease.count(delta)
color_rect.self_modulate.a = 1.0 - Clouds.sun_frac
func scene_changed(override := false):
up.clock = 0.0

View file

@ -25,6 +25,7 @@ __meta__ = {
}
[node name="ColorRect" type="ColorRect" parent="Control"]
visible = false
modulate = Color( 1, 1, 1, 0.109804 )
material = SubResource( 1 )
margin_right = 1280.0

View file

@ -1,11 +1,13 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://src/detail/Spring.gd" type="Script" id=1]
[ext_resource path="res://src/actor/shape/Rectangle.gd" type="Script" id=2]
[ext_resource path="res://media/image/details/candle.png" type="Texture" id=3]
[ext_resource path="res://media/audio/sfx/btn0.wav" type="AudioStream" id=4]
[ext_resource path="res://media/image/box/round_rect400.png" type="Texture" id=5]
[ext_resource path="res://src/shader/circle_fade.gdshader" type="Shader" id=6]
[ext_resource path="res://src/detail/LightBase.gd" type="Script" id=7]
[ext_resource path="res://media/image/details/flame.png" type="Texture" id=8]
[sub_resource type="ShaderMaterial" id=3]
shader = ExtResource( 6 )
@ -31,16 +33,33 @@ scale = Vector2( 0.25, 0.25 )
texture = ExtResource( 3 )
offset = Vector2( 0, -200 )
[node name="Light" type="Sprite" parent="Sprites" groups=["light"]]
[node name="Scale" type="Node2D" parent="Sprites"]
position = Vector2( 0, -66.5 )
script = ExtResource( 7 )
is_night = true
[node name="Flame" type="Sprite" parent="Sprites/Scale"]
position = Vector2( 0, -9 )
scale = Vector2( 0.25, 0.25 )
texture = ExtResource( 8 )
[node name="Light" type="Sprite" parent="Sprites/Scale" groups=["light"]]
modulate = Color( 0.996078, 1, 0.909804, 0.109804 )
material = SubResource( 3 )
position = Vector2( 0, -66 )
position = Vector2( 0, 0.5 )
scale = Vector2( 0.5, 0.5 )
z_index = 100
z_as_relative = false
texture = ExtResource( 5 )
script = ExtResource( 7 )
is_night = true
[node name="Wick" type="Polygon2D" parent="Sprites"]
position = Vector2( 0, -65 )
color = Color( 0, 0, 0, 1 )
polygon = PoolVector2Array( 3, 3.6, 2.15061, 5.65061, 0.0999998, 6.5, -0.1, 6.5, -2.15061, 5.65061, -3, 3.6, -3, -3.6, -2.15061, -5.65061, -0.0999999, -6.5, 0.0999999, -6.5, 2.15061, -5.65061, 3, -3.6 )
script = ExtResource( 2 )
size = Vector2( 3, 6.5 )
radius = Plane( -2, -1, -1, -1 )
points = 3
[node name="Area2D" type="Area2D" parent="."]
visible = false

View file

@ -27,7 +27,7 @@ texture = ExtResource( 1 )
offset = Vector2( 0, -200 )
[node name="Light" type="Sprite" parent="Sprites" groups=["light"]]
modulate = Color( 0.9955, 1, 0.91, 0.109804 )
modulate = Color( 0.996078, 1, 0.909804, 0.109804 )
material = SubResource( 5 )
position = Vector2( 0, -155 )
z_index = 100

View file

@ -7,11 +7,12 @@ export var sin_scale := 0.1
export var is_night := false
var night_ease := EaseMover.new(4.0)
var night_min := 0.3
onready var start_scale := scale
func _ready():
night_ease.clock = night_ease.time * int(fposmod(BG.frac - 0.2, 1.0) < 0.5)
night_ease.clock = night_ease.time * int(Clouds.moon_frac > night_min)
func _physics_process(delta):
t += delta
@ -19,6 +20,6 @@ func _physics_process(delta):
var s = 1.0 + (sin(t * time_scale) * sin_scale)
if is_night:
s *= night_ease.count(delta, fposmod(BG.frac - 0.2, 1.0) < 0.5)
s *= night_ease.count(delta, Clouds.moon_frac > night_min)
scale = start_scale * s

View file

@ -5,6 +5,7 @@
[ext_resource path="res://media/audio/sfx/bell1.wav" type="AudioStream" id=3]
[node name="Control" type="CanvasLayer"]
layer = 5
script = ExtResource( 2 )
[node name="ColorRect" type="ColorRect" parent="."]

View file

@ -1,10 +1,13 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://src/stage/SolidTileMap.gd" type="Script" id=1]
[ext_resource path="res://media/image/box/box-100.png" type="Texture" id=2]
[ext_resource path="res://src/stage/tileset/TileSet0.tres" type="TileSet" id=3]
[ext_resource path="res://src/shader/add_color.gdshader" type="Shader" id=4]
[sub_resource type="OccluderPolygon2D" id=5]
polygon = PoolVector2Array( 100, 100, 0, 100, 0, 0, 100, 0 )
[sub_resource type="ConvexPolygonShape2D" id=1]
points = PoolVector2Array( 100, 100, 0, 100, 0, 0, 100, 0 )
@ -16,6 +19,7 @@ points = PoolVector2Array( 100, 100, 0, 100, 0, 0, 100, 0 )
0/region = Rect2( 0, 0, 100, 100 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/occluder = SubResource( 5 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )