Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Starlight_Chronix |
I’m new to coding trying to create a 2d endless runner and only have one platform and struggling on how to generate different various platforms I don’t want them to be the same size as the first one I want more than one platform you could jump on and to also have them be in different sizes. One last thing the platforms only come in a straight line I want the platforms to randomly generate all over.
extends Node2D
const OBSTACLE = preload(“res://scenes/Platform_big.tscn”)
func _ready():
Global.current_score = 0
func _on_Timer_timeout():
var obstacle = OBSTACLE.instance()
add_child(obstacle)
func _on_ScoreTimer_timeout():
Global.current_score +=1
func _process(delta):
$Label.text = “” +str(Global.current_score)