This week we've been adding a bit of randomness to the game.
For this we've created random variables for both speed and direction of the meteorites, as well as creating different versions of the meteorite with different sizes.
func _ready():
randomize()
speed = randi_range(speed-20,speed+20) + (10 * Globals.actual_level)
if randf() > 0.75 :
direction = 0
else:
direction = randi_range(-speed, speed)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
position += transform.y * speed * delta
position += transform.x * direction * delta
if position.y > 700 :
queue_free()