@xyz said:
Hello :)
Could you elaborate a bit on what exactly you want to achieve with this piece of code?
Hello dear sir:). Something like this. Simple tutorial system with saving progress).
func _start_tutorial(progress):
match progress:
some_number:
tell_player_what_he_must_do()
while true:
if player_do_it_bad():
_start_tutorial(progress)
return
if player_do_it_good():
break
progress += 1
continue
some_number + 1:
tell_player_what_he_must_do()
while true:
if player_do_it_bad():
_start_tutorial(progress)
return
if player_do_it_good():
break
progress += 1
continue
@cybereality said:
No, it's not a good idea to change looping variables while you are looping, this can cause issues. It may just be a flaw in your logic. Or if the logic requires it, you can use a different control statement like a while loop.
I guess you right. But to achieve what i want i need two nested while loops which looks messy :(