spawner.gd 443 B

1234567891011121314151617181920
  1. extends Node2D
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. var offender_scene = preload("res://offender.tscn")
  6. # Called when the node enters the scene tree for the first time.
  7. func _ready():
  8. pass # Replace with function body.
  9. func spawn():
  10. var offender = offender_scene.instance()
  11. add_child(offender)
  12. # Called every frame. 'delta' is the elapsed time since the previous frame.
  13. #func _process(delta):
  14. # pass