among-eux

Game made in 1 day with flx
git clone git://git.vgx.fr/among-eux
Log | Files | Refs

Hidden.gd (377B)


      1 extends "res://Public.gd"
      2 
      3 export var detect_dist = 100.0
      4 
      5 var target
      6 
      7 var evil_scn = preload("res://Evil.tscn")
      8 
      9 func _ready():
     10 	init()
     11 	target = get_node("../President")
     12 
     13 func _process(delta):
     14 	if position.distance_to(target.position) < detect_dist:
     15 		var evil = evil_scn.instance()
     16 		evil.type = type
     17 		evil.position = position
     18 		get_parent().add_child(evil)
     19 		queue_free()