-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMaskedModifier.gd
More file actions
42 lines (37 loc) · 1.53 KB
/
MaskedModifier.gd
File metadata and controls
42 lines (37 loc) · 1.53 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
extends Spatial
export var lspd = 0.025 # lerp speed
var target:Vector3 # general target
var tps:float # target pixel scale
var top:float # target opacity
onready var Game:SongPlayerManager = $".." # game instance (to detect combo)
func _process(delta):
# set lerp targets
target = Vector3(
$"../Spawn/Cursor/Mesh".global_translation.x,
$"../Spawn/Cursor/Mesh".global_translation.y,
-0.1
)
if SSP.cam_unlock == true:
if Game.combo >= 100:
tps = 0.025
top = 1 # # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
elif Game.combo >= 50:
tps = 0.0275
top = 1 # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
else:
tps = 0.03
top = 1 # # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
else:
if Game.combo >= 100:
tps = 0.0125
top = 1 # # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
elif Game.combo >= 50:
tps = 0.015
top = 1 # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
else:
tps = 0.02
top = 1 # # opacity always 1 no matter what because fog thinks it cring! (keeping variable incase)
# application onto nodes
global_translation = lerp(global_translation,target,lspd*40) # lspd multiplied by 40 to increase speed
$Sprite.pixel_size = lerp($Sprite.pixel_size,tps,lspd/2) # lspd divided by 2 to increase time
$Sprite.opacity = lerp($Sprite.opacity,top,lspd/2) # lspd divided by 2 to increase time