X Tutup
Skip to content

Commit a0a42ae

Browse files
committed
More texture work
1 parent adcf138 commit a0a42ae

File tree

13 files changed

+195
-96
lines changed

13 files changed

+195
-96
lines changed

FarmNer/Assets/Flashlight/Flashlight.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ extends Node2D
33
var mousePos
44
var flashlightOn = false
55

6+
func _ready():
7+
GLOBAL.connect("turnOffFlashlight", self, "_turn_Off_Flashlight")
8+
69
func _physics_process(delta):
710
mousePos = get_local_mouse_position()
811
turnOnOffFlashlight()
@@ -51,3 +54,8 @@ func attackBeam():
5154

5255
func _on_Tween_tween_completed(object, key):
5356
$FlashLightBeamSound/AudioStreamPlayer2D.stop()
57+
58+
# Turns off flashlight from global
59+
func _turn_Off_Flashlight():
60+
flashlightOn = true
61+
$Sprite/Beam.enabled = 0

FarmNer/Assets/Flashlight/Flashlight.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[ext_resource path="res://FarmNer/Assets/Textures/flashlightBeam.png" type="Texture" id=4]
77
[ext_resource path="res://FarmNer/Sounds/FlashLight/FlashLightBeamSound.tscn" type="PackedScene" id=5]
88

9-
109
[node name="Flashlight" type="Node2D"]
1110
script = ExtResource( 3 )
1211

9.47 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/nastyStrands.png-1693db4dafaf79917422f3077b02cf6f.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://FarmNer/Assets/Textures/nastyStrands.png"
13+
dest_files=[ "res://.import/nastyStrands.png-1693db4dafaf79917422f3077b02cf6f.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0
12.8 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/nastyTexture.png-ddadc826130265e5abddedc2b17d81f3.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://FarmNer/Assets/Textures/nastyTexture.png"
13+
dest_files=[ "res://.import/nastyTexture.png-ddadc826130265e5abddedc2b17d81f3.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

FarmNer/Assets/TheNasty/TheNasty.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func _on_Area2D_input_event(viewport, event, shape_idx):
5959
$Tween.interpolate_property($Sprite.get_material(), "shader_param/value", 1, 0, 2.4, Tween.TRANS_LINEAR, Tween.EASE_IN)
6060
$Tween.start()
6161

62+
# Turns off flashlight
63+
GLOBAL.emit_signal("turnOffFlashlight")
64+
6265
rng.randomize()
6366
var randomAmountOfEnemies = rng.randi_range(2, 5)
6467
spawnEnemies(randomAmountOfEnemies)

FarmNer/Assets/TheNasty/TheNasty.tscn

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[gd_scene load_steps=13 format=2]
22

3-
[ext_resource path="res://FarmNer/Assets/TilesetScenes/TilesetGraveyard.png" type="Texture" id=1]
3+
[ext_resource path="res://FarmNer/Assets/Textures/nastyTexture.png" type="Texture" id=1]
44
[ext_resource path="res://FarmNer/Assets/Textures/lightTexture.png" type="Texture" id=2]
55
[ext_resource path="res://FarmNer/Assets/TheNasty/TheNasty.gd" type="Script" id=3]
66
[ext_resource path="res://FarmNer/Assets/Textures/smoke.png" type="Texture" id=4]
@@ -49,26 +49,26 @@ void fragment()
4949
}
5050
"
5151

52-
[sub_resource type="OpenSimplexNoise" id=7]
52+
[sub_resource type="OpenSimplexNoise" id=3]
5353
octaves = 9
5454

55-
[sub_resource type="NoiseTexture" id=6]
55+
[sub_resource type="NoiseTexture" id=4]
5656
width = 2048
5757
height = 2048
58-
noise = SubResource( 7 )
58+
noise = SubResource( 3 )
5959

60-
[sub_resource type="ShaderMaterial" id=3]
60+
[sub_resource type="ShaderMaterial" id=5]
6161
resource_local_to_scene = true
6262
shader = SubResource( 2 )
63-
shader_param/outline_color = Color( 1, 1, 1, 1 )
64-
shader_param/isOrbDead = 0
63+
shader_param/outline_color = Color( 1, 0, 0, 1 )
64+
shader_param/isOrbDead = false
6565
shader_param/turnOn = 0.0
6666
shader_param/value = 1.0
67-
shader_param/noise_texture = SubResource( 6 )
67+
shader_param/noise_texture = SubResource( 4 )
6868

69-
[sub_resource type="CircleShape2D" id=4]
69+
[sub_resource type="CircleShape2D" id=6]
7070

71-
[sub_resource type="RectangleShape2D" id=5]
71+
[sub_resource type="RectangleShape2D" id=7]
7272

7373
[node name="TheNasty" type="Node2D"]
7474
script = ExtResource( 3 )
@@ -80,10 +80,9 @@ position = Vector2( -3.16492, 1.41275 )
8080
scale = Vector2( 0.131266, 0.0971233 )
8181

8282
[node name="Light2D" type="Light2D" parent="."]
83-
position = Vector2( -3.58982, 2.17278 )
84-
scale = Vector2( 0.131266, 0.0971233 )
83+
position = Vector2( -3.86867, 2.93383 )
84+
scale = Vector2( 0.165794, 0.109271 )
8585
texture = ExtResource( 2 )
86-
energy = 0.8
8786
mode = 1
8887

8988
[node name="StaticBody2D" type="StaticBody2D" parent="."]
@@ -93,10 +92,11 @@ position = Vector2( -3.16492, 2.24607 )
9392
shape = SubResource( 1 )
9493

9594
[node name="Sprite" type="Sprite" parent="."]
96-
material = SubResource( 3 )
95+
material = SubResource( 5 )
96+
position = Vector2( -3.99342, 12.8266 )
9797
texture = ExtResource( 1 )
9898
region_enabled = true
99-
region_rect = Rect2( 88, 16, 24, 24 )
99+
region_rect = Rect2( 72, 32, 48, 48 )
100100

101101
[node name="CPUParticles2D" type="CPUParticles2D" parent="."]
102102
position = Vector2( -3.47111, 1.10718 )
@@ -112,22 +112,24 @@ angular_velocity = -371.61
112112
angular_velocity_random = 0.52
113113

114114
[node name="Area2D" type="Area2D" parent="."]
115+
scale = Vector2( 1.30785, 1.30785 )
115116
collision_layer = 8192
116117
collision_mask = 8192
117118

118119
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
119120
position = Vector2( -3.16492, 1.41275 )
120121
scale = Vector2( 0.922848, 0.922848 )
121-
shape = SubResource( 4 )
122+
shape = SubResource( 6 )
122123

123124
[node name="PlayerCollisionNasty" type="Area2D" parent="."]
125+
scale = Vector2( 1.48689, 1.48689 )
124126
collision_layer = 8193
125127
collision_mask = 8193
126128

127129
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerCollisionNasty"]
128130
position = Vector2( -3.16492, 2.24607 )
129131
scale = Vector2( 3.06093, 3.06093 )
130-
shape = SubResource( 5 )
132+
shape = SubResource( 7 )
131133
[connection signal="tween_completed" from="Tween" to="." method="_on_Tween_tween_completed"]
132134
[connection signal="input_event" from="Area2D" to="." method="_on_Area2D_input_event"]
133135
[connection signal="mouse_entered" from="Area2D" to="." method="_on_Area2D_mouse_entered"]

FarmNer/Assets/TilesetScenes/GravesAndRocksTiles.tscn

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,3 @@ position = Vector2( 120, 32 )
129129
texture = ExtResource( 1 )
130130
region_enabled = true
131131
region_rect = Rect2( 136, 0, 56, 56 )
132-
133-
[node name="22" type="Sprite" parent="."]
134-
position = Vector2( 24, 112 )
135-
texture = ExtResource( 1 )
136-
region_enabled = true
137-
region_rect = Rect2( 88, 16, 24, 24 )

FarmNer/GameManager/GlobalScript/global.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ signal onPlayerEnterLVL2TO1
99
signal onPlayerEnterLVL1TO3
1010
signal onPlayerEnterLVL3TO1
1111

12+
# Turn off flashlight signal
13+
14+
signal turnOffFlashlight
15+
1216
# Does the player have the orb killer unlocked
1317

1418
var orbDestroyerUnlocked = false

0 commit comments

Comments
 (0)
X Tutup