Hello, i was wondering if anyone knows how to generate platforms for a doodle jump clone since im confused about how i should approach this. Currently im using:
func _on_timer_timeout():
var platform_temp = platform_scene.instantiate()
platform_temp.position.x = randi_range(0,600)
platform_temp.position.y = randi_range(0,10000)
add_child(platform_temp)
This to generate the platforms but its not even close to the player and its unplayable. Any help would be amazing thanks in advance.
You will need a reference to the player to spawn things near the player, you could use @export potentially. Your random values can be relative to the player if you add the player’s position.
In @gertkeno 's answer (and mine, for that matter) we were assuming that you have a player of some sort in the game, and you probably called it player. There isn’t a built-in player as far as I’m aware, you have to make one. You can name it whatever you like, and just replace our use of player with doodle or whatever you use to represent the player’s avatar in the game.