save work and menu
This commit is contained in:
@@ -11,7 +11,7 @@ class_name Spawner
|
||||
@export var load_screen:= false
|
||||
|
||||
var current_time := 0.0
|
||||
|
||||
var global_time := 0.0
|
||||
signal add_collision
|
||||
|
||||
var list_of_collision_1 : Array[Node]
|
||||
@@ -34,7 +34,8 @@ func _process(delta: float) -> void:
|
||||
list_of_collision_1 = []
|
||||
list_of_collision_2 = []
|
||||
current_time += delta
|
||||
if current_time >= delay_spawn and ((load_screen and get_children().size() < 10) or not load_screen):
|
||||
global_time += delta
|
||||
if current_time >= clampf(delay_spawn * (1- (global_time / 200)), 0.5, 100) and ((load_screen and get_children().size() < 10) or not load_screen):
|
||||
current_time = 0
|
||||
spawn()
|
||||
|
||||
@@ -43,6 +44,7 @@ func spawn_duplicate(asteroid: Node2D):
|
||||
dup.type = asteroid.type
|
||||
dup.is_in = false
|
||||
var new_pos = (asteroid.position ).rotated(PI)
|
||||
dup.SPEED = asteroid.SPEED
|
||||
dup.position = new_pos
|
||||
dup.rotation = asteroid.rotation
|
||||
dup.direction = asteroid.direction
|
||||
@@ -66,6 +68,7 @@ func spawn():
|
||||
var new_global_position = Vector2(distance,0).rotated(randf_range(0.0, 360))
|
||||
new.global_position = new_global_position
|
||||
new.direction = (player.global_position - new_global_position).normalized()
|
||||
new.SPEED = randf() * 50 + 50 * ( 1 + (global_time / 200))
|
||||
add_child(new)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user