IceSpawner - SecondLesson

TaktycznyBocian avatar
TaktycznyBocian
plain_text
11/24/2022 11:33 PM
500 B
29
Indexable
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()
Editor is loading...