mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2024-11-12 17:11:18 +01:00
25 lines
475 B
GDScript
25 lines
475 B
GDScript
extends Panel
|
|
|
|
var enemy_pre = preload("res://Entity.tscn")
|
|
var enemy = null
|
|
var e_speed = 50
|
|
var e_life = 2
|
|
var Time = 0
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
if randi() % 2 == 0:
|
|
enemy = enemy_pre.instance()
|
|
add_child(enemy)
|
|
pass
|
|
|
|
func _process(delta):
|
|
Time += delta
|
|
if Time > 3.5:
|
|
if randi() % 2 == 0:
|
|
enemy = enemy_pre.instance()
|
|
enemy.speed = e_speed
|
|
enemy.life = e_life
|
|
add_child(enemy)
|
|
Time = 0
|