blob: f7fdec7a3537eeadaa37b1882cea921d1f95f1f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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()
|