diff options
Diffstat (limited to 'Main.gd')
-rw-r--r-- | Main.gd | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,4 +1,22 @@ extends Node +export (PackedScene) var chicken +export var num_chickens = 5 +export var spawn_radius = 4.0 + +func spawn_chicken(): + var loc = Vector2(randf()-0.5,randf()-0.5).normalized() * randf() * spawn_radius + var c = chicken.instance() + c.scale = Vector3(0.25,0.25,0.25) + c.translation = Vector3(loc.x,1.25,loc.y) + c.rotate(Vector3.UP, randf()*TAU) + c.mov_length_max = 3.0 + c.flap_chance = 2.0 + c.squack_chance = 2.0 + c.peck_chance = 3.0 + add_child(c) + func _ready(): randomize() + for i in range(num_chickens): + spawn_chicken() |