23 lines
742 B
GDScript
23 lines
742 B
GDScript
extends NPC
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
$Sprite.play()
|
|
|
|
func _on_area_2d_area_entered(area):
|
|
if area.name == "pigeonarea":
|
|
var pigeon = area.get_parent()
|
|
pigeon.global_position = Vector2(global_position.x - 44, global_position.y + 32)
|
|
pigeon.walking = false
|
|
pigeon.get_pats()
|
|
var pigeonsprite = pigeon.get_node("Sprite")
|
|
pigeonsprite.flip_h = true
|
|
|
|
if area.get_parent().name == "Cow":
|
|
var cow = area.get_parent()
|
|
cow.global_position = Vector2(global_position.x - 97, global_position.y + 62)
|
|
cow.set_target_position(cow.global_position)
|
|
cow.face_direction(false)
|
|
|
|
LevelManager.get_skill("appreciating").experience_event("Headpat Puppy", "was headpatted by", 250)
|