The camera now updates a shader with the positions, strengths and colors of nodes in the light group. The sources cast light around them on the z layer they are on. They do not work for Tilemaps yet and can't be occluded. The light of different sources does not get stronger if they overlap.
88 lines
3.0 KiB
Plaintext
88 lines
3.0 KiB
Plaintext
[gd_scene load_steps=7 format=2]
|
|
|
|
[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.gd" type="Script" id=1]
|
|
[ext_resource path="res://src/Environment/LightingShaderMaterial.tres" type="Material" id=2]
|
|
|
|
[sub_resource type="StreamTexture" id=5]
|
|
load_path = "res://.import/FlyingLaserCutter.png-9cf80385a79c58041216f8c2509a5bab.stex"
|
|
|
|
[sub_resource type="Animation" id=2]
|
|
length = 2.4
|
|
loop = true
|
|
tracks/0/type = "value"
|
|
tracks/0/path = NodePath(".:frame")
|
|
tracks/0/interp = 1
|
|
tracks/0/loop_wrap = false
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/keys = {
|
|
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2, 2.3 ),
|
|
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
|
"update": 1,
|
|
"values": [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0 ]
|
|
}
|
|
|
|
[sub_resource type="RectangleShape2D" id=3]
|
|
extents = Vector2( 11.4921, 11.9129 )
|
|
|
|
[sub_resource type="RectangleShape2D" id=4]
|
|
extents = Vector2( 3.06672, 10.9923 )
|
|
|
|
[node name="FlyingLaserCutter" type="Node2D"]
|
|
script = ExtResource( 1 )
|
|
|
|
[node name="FlyingLaserCutterBody" type="KinematicBody2D" parent="."]
|
|
collision_layer = 32
|
|
collision_mask = 57
|
|
collision/safe_margin = 0.001
|
|
|
|
[node name="Sprite" type="Sprite" parent="FlyingLaserCutterBody"]
|
|
material = ExtResource( 2 )
|
|
texture = SubResource( 5 )
|
|
hframes = 5
|
|
vframes = 5
|
|
frame = 21
|
|
__meta__ = {
|
|
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUZseWluZ0xhc2VyQ3V0dGVyQm9keS9TcHJpdGUvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL2NvbnRyYXB0aW9uL0ZseWluZ0xhc2VyQ3V0dGVyLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K"
|
|
}
|
|
|
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="FlyingLaserCutterBody/Sprite"]
|
|
anims/default = SubResource( 2 )
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="FlyingLaserCutterBody"]
|
|
visible = false
|
|
position = Vector2( -0.461, 0 )
|
|
shape = SubResource( 3 )
|
|
|
|
[node name="LaserArea" type="Area2D" parent="FlyingLaserCutterBody" groups=["harmful"]]
|
|
process_priority = -1
|
|
visible = false
|
|
collision_layer = 32
|
|
collision_mask = 3
|
|
|
|
[node name="PainZone" type="CollisionShape2D" parent="FlyingLaserCutterBody/LaserArea" groups=["harmful"]]
|
|
process_priority = -1
|
|
visible = false
|
|
position = Vector2( 9.64728, 0.0077219 )
|
|
shape = SubResource( 4 )
|
|
|
|
[node name="Triggers" type="Node2D" parent="FlyingLaserCutterBody"]
|
|
visible = false
|
|
position = Vector2( 0, 0.0077219 )
|
|
|
|
[node name="RayCast2D" type="RayCast2D" parent="FlyingLaserCutterBody/Triggers"]
|
|
position = Vector2( 3.92072e-12, 8.99337 )
|
|
rotation = -1.5708
|
|
scale = Vector2( 1, 1000 )
|
|
enabled = true
|
|
cast_to = Vector2( 0, 1 )
|
|
collision_mask = 9
|
|
|
|
[node name="RayCast2D2" type="RayCast2D" parent="FlyingLaserCutterBody/Triggers"]
|
|
position = Vector2( 0, -8.95621 )
|
|
rotation = -1.5708
|
|
scale = Vector2( 1, 1000 )
|
|
enabled = true
|
|
cast_to = Vector2( 0, 1 )
|
|
collision_mask = 9
|