Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. extends Node2D
  2.  
  3. var plateformRessource = preload("res://Instances/Plateform.tscn")
  4. var width
  5.  
  6. func _ready():
  7. width = get_viewport().get_rect().size.x
  8. randomize()
  9. var y = 0
  10. while y > -3000:
  11. #on crée l'instance
  12. var instantiatePlateform= plateformRessource.instance()
  13. instantiatePlateform.set_pos(Vector2(rand_range(-width/2,width/2),y))
  14. #on l'attache au tree
  15. add_child(instantiatePlateform)
  16. y -= rand_range(0,110)
  17.  
  18. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement