hello, I need some help.
I using randi to create ramdomly three scenes.
but each time the scene is created, the velocity increases.
extends Node2D
var speed = 400
func physicsprocess(delta):
var pos_x1 = position.x
pos_x1 -= speed1 * delta
position.x = pos_x1
func createmap():
randomize()
var alpha = load("res://scenes/map" + str(randi()%3 + 1) + ".tscn")
var alphainstance = alpha.instance()
alphainstance.position = Vector2(5400,0)
addchild(alphainstance)
$Timer.stop()
func onlimitebodyentered(body):
if "ninja" in body.name:
$Timer.start()
func onTimertimeout():
createmap()