This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.tscn
More file actions
238 lines (191 loc) · 8.39 KB
/
Copy pathPlayer.tscn
File metadata and controls
238 lines (191 loc) · 8.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
[gd_scene load_steps=42 format=2]
[ext_resource path="res://addons/easy_networking/network_syncer.gd" type="Script" id=1]
[ext_resource path="res://Player.gd" type="Script" id=2]
[ext_resource path="res://audio/escroompickup.wav" type="AudioStream" id=3]
[ext_resource path="res://Light_Cone2.0.png" type="Texture" id=4]
[ext_resource path="res://Light_Circle.png" type="Texture" id=5]
[ext_resource path="res://camera_controller.gd" type="Script" id=6]
[ext_resource path="res://ItemPivot.gd" type="Script" id=7]
[ext_resource path="res://art/playeranim/escape room player Green idle sprite sheet.png" type="Texture" id=8]
[ext_resource path="res://audio/footsteps/escroomsfx_foot1.wav" type="AudioStream" id=9]
[ext_resource path="res://audio/footsteps/escroomsfx_foot2.wav" type="AudioStream" id=10]
[ext_resource path="res://audio/footsteps/escroomsfx_foot4.wav" type="AudioStream" id=11]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 8.png" type="Texture" id=12]
[ext_resource path="res://audio/footsteps/escroomsfx_foot5.wav" type="AudioStream" id=13]
[ext_resource path="res://audio/footsteps/escroomsfx_foot6.wav" type="AudioStream" id=14]
[ext_resource path="res://audio/escroomLIGHT_ONN.wav" type="AudioStream" id=15]
[ext_resource path="res://audio/escroomLIGHT_OFF.wav" type="AudioStream" id=16]
[ext_resource path="res://notepad.tscn" type="PackedScene" id=17]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 6.png" type="Texture" id=18]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 3.png" type="Texture" id=19]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 1.png" type="Texture" id=20]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 4.png" type="Texture" id=21]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 2.png" type="Texture" id=22]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 5.png" type="Texture" id=23]
[ext_resource path="res://art/playeranim/escape room player Green walk left and right 7.png" type="Texture" id=24]
[ext_resource path="res://art/flashlight/flashlight 7.png" type="Texture" id=25]
[ext_resource path="res://art/flashlight/flashlight 2.png" type="Texture" id=26]
[ext_resource path="res://art/flashlight/flashlight 1.png" type="Texture" id=27]
[ext_resource path="res://art/flashlight/flashlight 4.png" type="Texture" id=28]
[ext_resource path="res://art/flashlight/flashlight 3.png" type="Texture" id=29]
[ext_resource path="res://art/flashlight/flashlight 6.png" type="Texture" id=30]
[ext_resource path="res://art/flashlight/flashlight 8.png" type="Texture" id=31]
[ext_resource path="res://art/flashlight/flashlight 5.png" type="Texture" id=32]
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 8 )
region = Rect2( 0, 0, 50, 50 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 8 )
region = Rect2( 50, 0, 50, 50 )
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ SubResource( 5 ), SubResource( 6 ) ],
"loop": true,
"name": "idle",
"speed": 0.75
}, {
"frames": [ ExtResource( 21 ), ExtResource( 23 ), ExtResource( 18 ), ExtResource( 24 ), ExtResource( 12 ), ExtResource( 20 ), ExtResource( 22 ), ExtResource( 19 ) ],
"loop": true,
"name": "walkleft",
"speed": 8.0
} ]
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 20.5, 5.936 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 17, 25.5 )
[sub_resource type="Shader" id=10]
code = "shader_type canvas_item;
uniform int megapixel_size_px: hint_range(1, 8) = 3;
void fragment() {
// Get the actual screen resolution.
vec2 screen_resolution = vec2(textureSize(SCREEN_TEXTURE, 0));
// Get the size of the megapixel in UV coordinates.
vec2 megapixel_size_uv = float(megapixel_size_px) / screen_resolution;
// Determine which megapixel the current fragment resides in.
vec2 current_megapixel = floor(FRAGCOORD.xy / float(megapixel_size_px));
// Determine the UV-coordinate of the bottem-left corner of the current megapixel.
vec2 current_megapixel_uv = (current_megapixel * float(megapixel_size_px)) / screen_resolution;
// Determine the UV-coordinate of the center of the current megapixel.
vec2 current_megapixel_center_uv = current_megapixel_uv + (megapixel_size_uv / 2.0);
// Use the color at the center of the megapixel as the final fragment color.
COLOR = textureLod(SCREEN_TEXTURE, current_megapixel_center_uv, 0.0);
}"
[sub_resource type="ShaderMaterial" id=11]
shader = SubResource( 10 )
shader_param/megapixel_size_px = 3
[sub_resource type="GDScript" id=4]
script/source = "extends Light2D
onready var player = get_node(\"../../\")
const FLICKER_INTENSITY = 0.025
const INT_DELTA = 0.019
const INIT_NRG = 1.0
var up = false
var nrg = INIT_NRG
var on = false
onready var onoff = [$on, $off]
func _process(delta):
if not player.controller:
if on != player.on:
if not on and player.on:
onoff[0].play()
elif on and not player.on:
onoff[1].play()
on = player.on
if up:
nrg += INT_DELTA
else:
nrg -= INT_DELTA
if FLICKER_INTENSITY + INIT_NRG < nrg or INIT_NRG - FLICKER_INTENSITY > nrg:
up = not up
if on:
energy = nrg
else:
energy = 0
func _input(event):
if player.controller:
if event.is_action_pressed(\"use_item\") and player.item_in_hand == \"Flashlight\":
on = true
player.on = true
# onoff[0].play()
if event.is_action_released(\"use_item\") and player.item_in_hand == \"Flashlight\":
on = false
player.on = false
# onoff[1].play()
"
[sub_resource type="SpriteFrames" id=7]
animations = [ {
"frames": [ ExtResource( 28 ), ExtResource( 29 ), ExtResource( 26 ), ExtResource( 27 ), ExtResource( 31 ), ExtResource( 25 ), ExtResource( 30 ), ExtResource( 32 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[node name="Player" type="KinematicBody2D"]
script = ExtResource( 2 )
__meta__ = {
"_edit_vertical_guides_": [ -147.0 ]
}
[node name="char" type="AnimatedSprite" parent="."]
scale = Vector2( 2, 2 )
frames = SubResource( 1 )
animation = "walkleft"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0.5, 35.936 )
shape = SubResource( 2 )
[node name="Item_Detector" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Item_Detector"]
position = Vector2( -3, 3.5 )
shape = SubResource( 3 )
[node name="pickup" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
[node name="Camera2D" type="Camera2D" parent="."]
material = SubResource( 11 )
script = ExtResource( 6 )
[node name="Node2D" parent="Camera2D" instance=ExtResource( 17 )]
modulate = Color( 1, 1, 1, 0 )
[node name="PlayerLight" type="Light2D" parent="."]
scale = Vector2( 3, 3 )
texture = ExtResource( 5 )
color = Color( 1, 1, 1, 0.607843 )
[node name="ItemPivot" type="Sprite" parent="."]
script = ExtResource( 7 )
[node name="Flashlight" type="Light2D" parent="ItemPivot"]
position = Vector2( 37, 3 )
scale = Vector2( 0.7, 1 )
texture = ExtResource( 4 )
offset = Vector2( 449.507, -5.277 )
energy = 1.2
shadow_enabled = true
script = SubResource( 4 )
[node name="on" type="AudioStreamPlayer" parent="ItemPivot/Flashlight"]
stream = ExtResource( 15 )
volume_db = 1.683
[node name="off" type="AudioStreamPlayer" parent="ItemPivot/Flashlight"]
stream = ExtResource( 16 )
volume_db = 1.683
[node name="Item" type="AnimatedSprite" parent="ItemPivot"]
position = Vector2( 22, 0 )
scale = Vector2( 2, 2 )
frames = SubResource( 7 )
[node name="footsteps1" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
volume_db = -12.898
[node name="footsteps2" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 10 )
volume_db = -12.898
[node name="footsteps3" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 13 )
volume_db = -12.898
[node name="footsteps4" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 11 )
volume_db = -12.898
[node name="footsteps5" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 13 )
volume_db = -12.898
[node name="footsteps6" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 14 )
volume_db = -12.898
[node name="syncer" type="Node" parent="."]
process_priority = -1
script = ExtResource( 1 )
synced_properties = PoolStringArray( "transform", "dir_x", "item_in_hand", "item_in_backpack", "transrot", "pickup" )
synced_booleans = PoolStringArray( "on", "dropped" )