I need to make a longnote like within the recreation Friday Evening Funkin.
If you do not know FNF that is the lengthy notes: https://www.youtube.com/watch?v=dXZ5Zmnk6Yg
Code:
if (Enter.is_action_pressed("up")) or (Enter.is_action_pressed("down")) or (Enter.is_action_pressed("proper")) or (Enter.is_action_pressed("left")):
mouseheld = true
else:
mouseheld = false
if (isLongNote == true) and (Enter.is_action_just_pressed("up") and touching == true and sprite.rotation_degrees == 0) or (Enter.is_action_just_pressed("down") and touching == true and sprite.rotation_degrees == -180) or (Enter.is_action_just_pressed("proper") and touching == true and sprite.rotation_degrees == 90) or (Enter.is_action_just_pressed("left") and touching == true and sprite.rotation_degrees == -90):
createAEffect()
print(mouseheld)
if mouseheld == false:
Singletons.dangerous()
queue_free()
print(mouseheld)
# COMMENT HERE
if mouseheld == true:
print('rlly good')
Singletons.sick()
queue_free()
else:
print('...')
Singletons.good()
queue_free()
The issue is at the place I put a remark, I attempted to place a yield perform (principally wait a second and see if the mouse continues to be held) however the yield perform (yield(get_tree().create_timer(1)), “timeout”) did not work (for some motive doesnt work within a perform)
Is there a greater approach to do that?