Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Node2D
- var plateformRessource = preload("res://Instances/Plateform.tscn")
- var width
- func _ready():
- width = get_viewport().get_rect().size.x
- randomize()
- var y = 0
- while y > -3000:
- #on crée l'instance
- var instantiatePlateform= plateformRessource.instance()
- instantiatePlateform.set_pos(Vector2(rand_range(-width/2,width/2),y))
- #on l'attache au tree
- add_child(instantiatePlateform)
- y -= rand_range(0,110)
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement