mirror of
https://github.com/Steffo99/watermelonkeys-patched-ld51.git
synced 2024-11-21 23:54:19 +00:00
207 lines
12 KiB
Text
207 lines
12 KiB
Text
[gd_scene load_steps=13 format=2]
|
|
|
|
[ext_resource path="res://light.tscn" type="PackedScene" id=1]
|
|
[ext_resource path="res://Giovanna.tscn" type="PackedScene" id=2]
|
|
[ext_resource path="res://brick_tileset.tres" type="TileSet" id=3]
|
|
[ext_resource path="res://ASSETS/Background/Layer 7.png" type="Texture" id=4]
|
|
[ext_resource path="res://ASSETS/Background/Skyline2.png" type="Texture" id=5]
|
|
[ext_resource path="res://ASSETS/Background/Skyline1.png" type="Texture" id=6]
|
|
[ext_resource path="res://ASSETS/Sunimation/Sun_0_5000ms.png" type="Texture" id=8]
|
|
|
|
[sub_resource type="GDScript" id=3]
|
|
script/source = "extends Node2D
|
|
|
|
signal day
|
|
signal night
|
|
|
|
export(CanvasItemMaterial) var tiles_mat
|
|
|
|
onready var layer_1 = $ParallaxBackground/ParallaxLayer2
|
|
onready var layer_2 = $\"ParallaxBackground/Purple Sky\"
|
|
onready var layer_3 = $ParallaxBackground/ParallaxLayer
|
|
onready var sun_sprite = $ParallaxBackground/ParallaxLayer2/Sun
|
|
|
|
func _ready():
|
|
tiles_mat.light_mode = CanvasItemMaterial.LIGHT_MODE_UNSHADED
|
|
|
|
emit_signal(\"day\")
|
|
|
|
func _input(event):
|
|
if Input.is_action_just_pressed(\"quit\"):
|
|
get_tree().quit()
|
|
|
|
func _on_sun_anim_done():
|
|
var tween = create_tween()
|
|
tween.set_parallel(false)
|
|
tween.tween_property(layer_1, \"modulate\", Color.black, 0.3)
|
|
tween.tween_property(layer_2, \"modulate\", Color.black, 0.3).set_delay(0.1)
|
|
tween.tween_property(layer_3, \"modulate\", Color.black, 0.3).set_delay(0.1)
|
|
|
|
yield(tween, \"finished\")
|
|
|
|
tiles_mat.light_mode = CanvasItemMaterial.LIGHT_MODE_LIGHT_ONLY
|
|
emit_signal(\"night\")
|
|
|
|
yield(get_tree().create_timer(10.0), \"timeout\")
|
|
|
|
fade_back_in()
|
|
|
|
func fade_back_in():
|
|
sun_sprite.animate()
|
|
|
|
tiles_mat.light_mode = CanvasItemMaterial.LIGHT_MODE_UNSHADED
|
|
|
|
var tween = create_tween()
|
|
tween.set_parallel(false)
|
|
tween.tween_property(layer_3, \"modulate\", Color.white, 0.3)
|
|
tween.tween_property(layer_2, \"modulate\", Color.white, 0.3).set_delay(0.1)
|
|
tween.tween_property(layer_1, \"modulate\", Color.white, 0.3).set_delay(0.1)
|
|
|
|
yield(tween, \"finished\")
|
|
|
|
emit_signal(\"day\")
|
|
|
|
func _on_DeathZone_body_entered(body):
|
|
get_tree().change_scene(\"res://Dead.tscn\")
|
|
"
|
|
|
|
[sub_resource type="CanvasItemMaterial" id=7]
|
|
light_mode = 2
|
|
|
|
[sub_resource type="GDScript" id=6]
|
|
script/source = "extends Sprite
|
|
|
|
export(String, DIR) var sun_frames_path = \"res://ASSETS/Sunimation\"
|
|
|
|
signal sun_anim_done
|
|
|
|
var frames := []
|
|
var timer := Timer.new()
|
|
|
|
func _ready():
|
|
add_child(timer)
|
|
timer.one_shot = true
|
|
|
|
var frames_names = list_files_in_directory(sun_frames_path, [\"png\"])
|
|
frames.resize(len(frames_names))
|
|
|
|
for f in frames_names:
|
|
var tokens = f.trim_prefix(\"Sun_\").trim_suffix(\"ms.png\").split(\"_\")
|
|
|
|
# print(f, \" \", tmp, \" \", tokens)
|
|
|
|
var idx = int(tokens[0])
|
|
frames[idx] = {
|
|
file = \"%s/%s\" % [sun_frames_path, f],
|
|
frame_len = float(tokens[1])/1000.0
|
|
}
|
|
|
|
# print(frames)
|
|
animate()
|
|
|
|
func animate():
|
|
for fr in frames:
|
|
texture = load(fr.file)
|
|
timer.start(fr.frame_len)
|
|
|
|
yield(timer, \"timeout\")
|
|
|
|
texture = null
|
|
emit_signal(\"sun_anim_done\")
|
|
|
|
func list_files_in_directory(path, ext_filter := [], allow_hidden := false):
|
|
var files = []
|
|
var dir = Directory.new()
|
|
dir.open(path)
|
|
dir.list_dir_begin()
|
|
|
|
var file = dir.get_next()
|
|
while file != \"\":
|
|
var is_hidden = file.begins_with(\".\")
|
|
var ext_ok = (len(ext_filter) == 0 or file.get_extension() in ext_filter)
|
|
if (not is_hidden or allow_hidden) and ext_ok:
|
|
files.append(file)
|
|
file = dir.get_next()
|
|
|
|
dir.list_dir_end()
|
|
|
|
return files
|
|
"
|
|
|
|
[sub_resource type="GDScript" id=5]
|
|
script/source = "extends Area2D
|
|
|
|
func _process(delta):
|
|
var p = owner.get_meta(\"player\")
|
|
global_position.x = p.global_position.x
|
|
"
|
|
|
|
[sub_resource type="RectangleShape2D" id=4]
|
|
extents = Vector2( 2255, 43 )
|
|
|
|
[node name="Level1" type="Node2D"]
|
|
script = SubResource( 3 )
|
|
tiles_mat = SubResource( 7 )
|
|
|
|
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
|
|
|
[node name="ParallaxLayer2" type="ParallaxLayer" parent="ParallaxBackground"]
|
|
motion_scale = Vector2( 0, 0 )
|
|
|
|
[node name="Skybox" type="Sprite" parent="ParallaxBackground/ParallaxLayer2"]
|
|
texture = ExtResource( 4 )
|
|
|
|
[node name="Sun" type="Sprite" parent="ParallaxBackground/ParallaxLayer2"]
|
|
position = Vector2( 0, 62 )
|
|
texture = ExtResource( 8 )
|
|
script = SubResource( 6 )
|
|
|
|
[node name="Purple Sky" type="ParallaxLayer" parent="ParallaxBackground"]
|
|
position = Vector2( 0, -90 )
|
|
motion_scale = Vector2( 0.4, 0.4 )
|
|
motion_mirroring = Vector2( 1920, 0 )
|
|
|
|
[node name="Sprite" type="Sprite" parent="ParallaxBackground/Purple Sky"]
|
|
position = Vector2( 150, 166 )
|
|
z_index = -10
|
|
texture = ExtResource( 6 )
|
|
|
|
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
|
|
position = Vector2( 1, 138 )
|
|
motion_scale = Vector2( 0.65, 0.65 )
|
|
motion_mirroring = Vector2( 1920, 0 )
|
|
|
|
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
|
|
position = Vector2( -4, 0 )
|
|
texture = ExtResource( 5 )
|
|
|
|
[node name="TileMap" type="TileMap" parent="."]
|
|
material = SubResource( 7 )
|
|
tile_set = ExtResource( 3 )
|
|
cell_size = Vector2( 16, 16 )
|
|
format = 1
|
|
tile_data = PoolIntArray( -262117, 0, 0, 131074, 20, 0, 262148, 20, 0, 393241, 1, 0, 393242, 2, 0, 393243, 17, 0, 393245, 1, 0, 393246, 15, 0, 393247, 15, 0, 393248, 15, 0, 393249, 15, 0, 393250, 15, 0, 393251, 15, 0, 393252, 17, 0, 458777, 4, 0, 458778, 7, 0, 458779, 8, 0, 458781, 4, 0, 458782, 10, 0, 458783, 9, 0, 458784, 10, 0, 458785, 9, 0, 458786, 10, 0, 458787, 9, 0, 458788, 16, 0, 458789, 17, 0, 524291, 20, 0, 524309, 1, 0, 524310, 2, 0, 524311, 3, 0, 524317, 19, 0, 524319, 19, 0, 524321, 19, 0, 524323, 4, 0, 524324, 10, 0, 524325, 16, 0, 524326, 17, 0, 589845, 6, 0, 589846, 7, 0, 589847, 8, 0, 589853, 19, 0, 589855, 19, 0, 589857, 19, 0, 589859, 19, 0, 589861, 13, 0, 589862, 16, 0, 589863, 17, 0, 655360, 3, 0, 655378, 1, 0, 655379, 3, 0, 655389, 19, 0, 655391, 19, 0, 655393, 19, 0, 655395, 19, 0, 655397, 4, 0, 655398, 10, 0, 655399, 16, 0, 655400, 17, 0, 720896, 12, 0, 720897, 20, 0, 720914, 6, 0, 720915, 8, 0, 720925, 19, 0, 720927, 19, 0, 720929, 19, 0, 720931, 19, 0, 720933, 19, 0, 720935, 13, 0, 720936, 10, 0, 720937, 17, 0, 720941, 25, 0, 720942, 2, 0, 720943, 24, 0, 786432, 12, 0, 786436, 20, 0, 786442, 18, 0, 786443, 1, 0, 786444, 2, 0, 786445, 2, 0, 786446, 2, 0, 786447, 2, 0, 786448, 3, 0, 786461, 19, 0, 786463, 19, 0, 786465, 19, 0, 786467, 19, 0, 786469, 19, 0, 786471, 19, 0, 786473, 19, 0, 786478, 19, 0, 851968, 12, 0, 851977, 18, 0, 851978, 16, 0, 851979, 6, 0, 851980, 7, 0, 851981, 7, 0, 851982, 7, 0, 851983, 7, 0, 851984, 8, 0, 851997, 19, 0, 851999, 19, 0, 852001, 19, 0, 852003, 19, 0, 852005, 19, 0, 852007, 19, 0, 852009, 19, 0, 852014, 19, 0, 983030, 20, 0, 917504, 12, 0, 917506, 20, 0, 917512, 18, 0, 917513, 16, 0, 917514, 0, 0, 917515, 5, 0, 917533, 19, 0, 917535, 19, 0, 917537, 19, 0, 917539, 19, 0, 917541, 19, 0, 917543, 19, 0, 917545, 19, 0, 917550, 19, 0, 983040, 12, 0, 983047, 18, 0, 983048, 16, 0, 983049, 0, 0, 983069, 19, 0, 983071, 19, 0, 983073, 19, 0, 983075, 19, 0, 983077, 19, 0, 983079, 19, 0, 983081, 19, 0, 983086, 19, 0, 1048576, 14, 0, 1048577, 2, 0, 1048578, 2, 0, 1048579, 2, 0, 1048580, 2, 0, 1048581, 2, 0, 1048582, 2, 0, 1048583, 2, 0, 1048584, 2, 0, 1048585, 2, 0, 1048594, 2, 0, 1048595, 2, 0, 1048596, 2, 0, 1048597, 2, 0, 1048598, 2, 0, 1048599, 2, 0, 1048600, 2, 0, 1048601, 2, 0, 1048602, 2, 0, 1048603, 2, 0, 1048604, 2, 0, 1048605, 5, 0, 1048607, 19, 0, 1048609, 19, 0, 1048611, 19, 0, 1048613, 19, 0, 1048615, 19, 0, 1048617, 19, 0, 1048622, 19, 0, 1048623, 23, 0, 1048624, 23, 0, 1048625, 23, 0, 1048626, 23, 0, 1048627, 23, 0, 1048628, 23, 0, 1048629, 23, 0, 1048630, 23, 0, 1048631, 23, 0, 1048632, 23, 0, 1048633, 23, 0, 1048634, 23, 0, 1048635, 23, 0, 1048636, 23, 0, 1048637, 23, 0, 1048638, 23, 0, 1048639, 23, 0, 1048640, 23, 0, 1048641, 23, 0, 1048642, 23, 0, 1048643, 23, 0, 1048644, 23, 0, 1048645, 23, 0, 1048646, 23, 0, 1048647, 23, 0, 1048648, 23, 0, 1048649, 23, 0, 1048650, 23, 0, 1048651, 23, 0, 1048652, 23, 0, 1048653, 23, 0, 1048654, 23, 0, 1048655, 23, 0, 1048656, 23, 0, 1048657, 23, 0, 1048658, 23, 0, 1048659, 23, 0, 1048660, 23, 0, 1048661, 23, 0, 1048662, 23, 0, 1048663, 23, 0, 1048664, 23, 0, 1048665, 23, 0, 1048666, 23, 0, 1048667, 23, 0, 1048668, 23, 0, 1048669, 23, 0, 1048670, 23, 0, 1048671, 23, 0, 1048672, 23, 0, 1048673, 23, 0, 1048674, 23, 0, 1048675, 23, 0, 1048676, 23, 0, 1048677, 23, 0, 1048678, 23, 0, 1048679, 23, 0, 1048680, 23, 0, 1048681, 23, 0, 1048682, 23, 0, 1048683, 23, 0, 1048684, 23, 0, 1048685, 23, 0, 1048686, 23, 0, 1048687, 23, 0, 1048688, 23, 0, 1048689, 23, 0, 1048690, 23, 0, 1048691, 23, 0, 1048692, 23, 0, 1048693, 23, 0, 1048694, 23, 0, 1048695, 23, 0, 1048696, 23, 0, 1048697, 23, 0, 1048698, 23, 0, 1048699, 23, 0, 1048700, 23, 0, 1048701, 23, 0, 1048702, 23, 0, 1048703, 23, 0, 1048704, 23, 0, 1048705, 23, 0, 1048706, 23, 0, 1048707, 23, 0, 1048708, 23, 0, 1048709, 23, 0, 1048710, 23, 0, 1048711, 23, 0, 1048712, 23, 0, 1048713, 23, 0, 1048714, 23, 0, 1048715, 23, 0, 1048716, 23, 0, 1048717, 23, 0, 1048718, 23, 0, 1048719, 23, 0, 1048720, 23, 0, 1048721, 23, 0, 1048722, 23, 0, 1048723, 23, 0, 1048724, 23, 0, 1048725, 23, 0, 1048726, 23, 0, 1048727, 23, 0, 1048728, 23, 0, 1048729, 23, 0, 1048730, 23, 0, 1048731, 23, 0, 1048732, 23, 0, 1048733, 23, 0, 1048734, 23, 0, 1048735, 23, 0, 1048736, 23, 0, 1048737, 23, 0, 1048738, 23, 0, 1048739, 23, 0, 1048740, 23, 0, 1048741, 23, 0, 1048742, 23, 0, 1048743, 23, 0, 1048744, 23, 0, 1048745, 23, 0, 1048746, 23, 0, 1048747, 23, 0, 1048748, 23, 0, 1048749, 23, 0, 1048750, 23, 0, 1048751, 23, 0, 1048752, 23, 0, 1048753, 23, 0, 1048754, 23, 0, 1048755, 23, 0, 1048756, 23, 0, 1048757, 23, 0, 1048758, 23, 0, 1048759, 23, 0, 1048760, 23, 0, 1048761, 23, 0, 1048762, 23, 0, 1048763, 23, 0, 1048764, 23, 0, 1048765, 23, 0, 1048766, 23, 0, 1048767, 23, 0, 1048768, 23, 0, 1048769, 23, 0, 1048770, 23, 0, 1048771, 23, 0, 1048772, 23, 0, 1048773, 23, 0, 1048774, 23, 0, 1048775, 23, 0, 1048776, 23, 0, 1048777, 23, 0, 1048778, 23, 0, 1048779, 23, 0, 1048780, 23, 0, 1048781, 23, 0, 1048782, 23, 0, 1048783, 23, 0, 1048784, 23, 0, 1048785, 23, 0, 1048786, 23, 0, 1048787, 23, 0, 1048788, 23, 0, 1048789, 23, 0, 1048790, 23, 0, 1048791, 23, 0, 1048792, 23, 0, 1048793, 23, 0, 1048794, 23, 0, 1048795, 23, 0, 1048796, 23, 0, 1048797, 23, 0, 1048798, 23, 0, 1048799, 23, 0, 1048800, 23, 0, 1048801, 23, 0, 1048802, 23, 0, 1048803, 23, 0, 1048804, 23, 0, 1048805, 23, 0, 1048806, 23, 0, 1048807, 23, 0, 1048808, 23, 0, 1048809, 23, 0, 1048810, 23, 0, 1048811, 23, 0, 1048812, 23, 0, 1048813, 23, 0, 1048814, 23, 0, 1048815, 23, 0, 1048816, 23, 0, 1048817, 23, 0, 1048818, 23, 0, 1048819, 23, 0, 1048820, 23, 0, 1048821, 23, 0, 1048822, 23, 0, 1048823, 23, 0, 1048824, 23, 0, 1048825, 23, 0, 1048826, 23, 0, 1048827, 23, 0, 1048828, 23, 0, 1048829, 23, 0, 1114142, 23, 0, 1114143, 10, 0, 1114144, 23, 0, 1114145, 10, 0, 1114146, 23, 0, 1114147, 10, 0, 1114148, 23, 0, 1114149, 10, 0, 1114150, 23, 0, 1114151, 10, 0, 1114152, 23, 0, 1114153, 8, 0, 1114158, 19, 0 )
|
|
|
|
[node name="light" parent="." instance=ExtResource( 1 )]
|
|
position = Vector2( 213, 172 )
|
|
__meta__ = {
|
|
"_edit_group_": true,
|
|
"_edit_horizontal_guides_": [ ]
|
|
}
|
|
|
|
[node name="DeathZone" type="Area2D" parent="."]
|
|
position = Vector2( 1, 328 )
|
|
script = SubResource( 5 )
|
|
__meta__ = {
|
|
"_edit_group_": true
|
|
}
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeathZone"]
|
|
position = Vector2( 1771, 12 )
|
|
shape = SubResource( 4 )
|
|
|
|
[node name="Player" parent="." instance=ExtResource( 2 )]
|
|
position = Vector2( 73, 39 )
|
|
|
|
[connection signal="sun_anim_done" from="ParallaxBackground/ParallaxLayer2/Sun" to="." method="_on_sun_anim_done"]
|
|
[connection signal="body_entered" from="DeathZone" to="." method="_on_DeathZone_body_entered"]
|