IceSpawner - SecondLesson

 avatar
TaktycznyBocian
plain_text
2 years ago
374 B
14
Indexable
Never
extends Node2D

onready var timer = $Timer
var Projectile = preload("res://Ice.tscn")

func spawn_projectile():
	var projectile = Projectile.instance()
	add_child(projectile)
	projectile.position.x = randi()%1000 + 5


func _on_Timer_timeout():
	spawn_projectile()

func _ready():
	randomize()

func start():
	timer.start()

func stop():
	timer.stop()