Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. extends Node
  2.  
  3. func my_looper():
  4. for x in 4:
  5. yield()
  6. print("I am %sx awesome" % x)
  7.  
  8. func _ready():
  9. var v = my_looper()
  10.  
  11. # Question 1: HOW WILL WE CALL ALL THE SUBROUTINES ?
  12. # OPTION 1!
  13. # v.resume()
  14. # v.resume()
  15. # v.resume() ... until all the FunctionState is empty
  16. # OPTION 2!
  17. # v.resume().resume() ... for every FunctionState returned
  18. # OPTION 3!
  19. # v.resume() .. doing it once is enough
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement