Workers, lighting, and loading

This commit is contained in:
2020-05-16 17:05:44 -04:00
parent 7528cba7d7
commit a26da07f43
61 changed files with 905 additions and 24 deletions

200
client/Nodes/Door.tscn Normal file
View File

@ -0,0 +1,200 @@
[gd_scene load_steps=14 format=2]
[ext_resource path="res://Assets/Art/Objects/door.png" type="Texture" id=1]
[ext_resource path="res://Assets/Sfx/door.wav" type="AudioStream" id=2]
[ext_resource path="res://Scripts/Entities/Door.gd" type="Script" id=3]
[ext_resource path="res://Assets/Art/32x32mask.png" type="Texture" id=5]
[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 16.0007, 15.9043 )
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 32, 32 )
[sub_resource type="OccluderPolygon2D" id=8]
polygon = PoolVector2Array( -5, 18, -5, 0, -2, 0, -2, 4, 2, 4, 2, 0, 5, 0, 5, 18 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
region = Rect2( 0, 32, 32, 32 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 0, 64, 32, 32 )
[sub_resource type="OccluderPolygon2D" id=9]
polygon = PoolVector2Array( 5, -18, 5, 0, -5, 0, -5, -18 )
[sub_resource type="Animation" id=5]
resource_name = "Close"
length = 0.5
tracks/0/type = "bezier"
tracks/0/path = NodePath("Top:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/1/type = "bezier"
tracks/1/path = NodePath("Top:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( -32, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/2/type = "bezier"
tracks/2/path = NodePath("Top:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/3/type = "bezier"
tracks/3/path = NodePath("Bottom:position:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/4/type = "bezier"
tracks/4/path = NodePath("Bottom:position:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"points": PoolRealArray( 32, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/5/type = "bezier"
tracks/5/path = NodePath("Bottom:rotation_degrees")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
[sub_resource type="Animation" id=4]
resource_name = "Open"
length = 0.5
tracks/0/type = "bezier"
tracks/0/path = NodePath("Bottom:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/1/type = "bezier"
tracks/1/path = NodePath("Bottom:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 32, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/2/type = "bezier"
tracks/2/path = NodePath("Bottom:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/3/type = "bezier"
tracks/3/path = NodePath("Top:position:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/4/type = "bezier"
tracks/4/path = NodePath("Top:position:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, -32, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
tracks/5/type = "bezier"
tracks/5/path = NodePath("Top:rotation_degrees")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5 )
}
[sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 40.2987, 16.0621 )
[node name="Door" type="Area2D"]
script = ExtResource( 3 )
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource( 7 )
[node name="Bottom" type="Sprite" parent="."]
z_index = 25
texture = SubResource( 1 )
[node name="LightOccluder2D" type="LightOccluder2D" parent="Bottom"]
occluder = SubResource( 8 )
[node name="Top" type="Sprite" parent="."]
z_index = 25
texture = SubResource( 2 )
[node name="Color" type="Sprite" parent="Top"]
texture = SubResource( 3 )
[node name="LightOccluder2D" type="LightOccluder2D" parent="Top"]
occluder = SubResource( 9 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Close = SubResource( 5 )
anims/Open = SubResource( 4 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 6 )
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 2 )
bus = "Sfx"
[node name="Mask" type="Light2D" parent="."]
enabled = false
texture = ExtResource( 5 )
mode = 3
range_item_cull_mask = 2

View File

@ -4,8 +4,8 @@
[ext_resource path="res://Scripts/Component/StorySpeaker.gd" type="Script" id=2]
[ext_resource path="res://Assets/Art/Characters/scientist.png" type="Texture" id=3]
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 5, 8 )
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 14.1446, 9.58948 )
[node name="Scientist" type="Area2D"]
position = Vector2( 167.084, 231.933 )
@ -15,7 +15,7 @@ script = ExtResource( 1 )
texture = ExtResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )
shape = SubResource( 1 )
[node name="Speaker" type="Node" parent="."]
script = ExtResource( 2 )

View File

@ -2,7 +2,7 @@
[ext_resource path="res://Assets/Materials/SmoothScaling.tres" type="Material" id=1]
[ext_resource path="res://Assets/Art/Characters/player_parts.png" type="Texture" id=2]
[ext_resource path="res://animation_reference.png" type="Texture" id=3]
[ext_resource path="res://Assets/Art/basic_light.png" type="Texture" id=3]
[ext_resource path="res://Scripts/Entities/Player.gd" type="Script" id=4]
[sub_resource type="AtlasTexture" id=1]
@ -870,13 +870,9 @@ anims/Idle = SubResource( 17 )
anims/RunLeft = SubResource( 18 )
anims/RunRight = SubResource( 19 )
[node name="Sprite" type="Sprite" parent="."]
visible = false
modulate = Color( 1, 1, 1, 0.423529 )
position = Vector2( -28.5601, 3.4707 )
scale = Vector2( 0.055, 0.055 )
texture = ExtResource( 3 )
flip_h = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 20 )
[node name="Light2D" type="Light2D" parent="."]
texture = ExtResource( 3 )
energy = 0.25

View File

@ -1,15 +1,28 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Assets/Art/basic_light.png" type="Texture" id=1]
[ext_resource path="res://Assets/Art/Objects/wall_light.png" type="Texture" id=2]
[ext_resource path="res://Scripts/Component/LightLoader.gd" type="Script" id=3]
[ext_resource path="res://Scripts/Entities/Wall Light.gd" type="Script" id=4]
[sub_resource type="CircleShape2D" id=1]
radius = 200.0
[node name="Wall Light" type="Sprite"]
texture = ExtResource( 2 )
script = ExtResource( 4 )
[node name="Light2D" type="Light2D" parent="."]
visible = false
texture = ExtResource( 1 )
texture_scale = 3.0
energy = 1.1
shadow_enabled = true
shadow_filter = 5
shadow_filter_smooth = 0.5
shadow_item_cull_mask = 3
[node name="Area2D" type="Area2D" parent="."]
script = ExtResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
visible = false
shape = SubResource( 1 )