func _ready() -> void:
$ScoreCount.text = str(Globals.Score)
for i in range(4 + Globals.Score):
for i1 in range(num):
var p1 = player1.instance()
p1.connect("Player1_pressed", self, "_on_Player1_pressed")
if Globals.timeLeft > 0:
Globals.timeLeft += 5
if Globals.timeLeft > Globals.maxTime:
Globals.timeLeft = Globals.maxTime
Globals.Score += 1
var rand1 = floor(rand_range(0, Enemy1.size()))
var piece1 = Enemy1[rand1].instance()
This is my Main Scene Code.
I want that when the onPlayer1_ pressed event happens that the Scene doesn't start right away, it should wait like 2 seconds before load to the next Scene (i tried some things with the Timer Node). And if the onPlayer1_ pressed event happends and the Waittime is set, i want it that the Player Freezes and Enemies are not visible for the duration of the Waittime. And it should not register Score more than 1 time for each Scene.
Thank you in advance for AndyCampbell and jgodfrey :/ i still wait for the Random Functions solution, i sent the code on a comment there.