Beginning of lesson 33. House polygon working and we are able to speak with NPC at world map, but not in starter town.
This commit is contained in:
@@ -5,8 +5,14 @@ class_name ToggleRoofTrigger
|
||||
@export var layerName:String
|
||||
|
||||
func execute(target):
|
||||
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName)
|
||||
pass
|
||||
|
||||
|
||||
func _on_area_entered(area: Area2D) -> void:
|
||||
execute(area.get_parent())
|
||||
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName, false)
|
||||
print("entered")
|
||||
|
||||
|
||||
func _on_area_exited(area: Area2D) -> void:
|
||||
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName, true)
|
||||
print("exited")
|
||||
|
||||
@@ -9,6 +9,8 @@ class_name Mob
|
||||
@export var collisionRay_1:RayCast2D
|
||||
@export var collisionRay_2:RayCast2D
|
||||
|
||||
@export var speechCollider:Area2D
|
||||
|
||||
func updateRaycasts(destination):
|
||||
var direction = destination - position
|
||||
|
||||
@@ -80,3 +82,7 @@ func wouldCollideAt(destination):
|
||||
|
||||
if collisionRay_1.is_colliding() || collisionRay_2.is_colliding():
|
||||
return true
|
||||
|
||||
|
||||
func interact():
|
||||
print("Player interacted with %s" % name)
|
||||
|
||||
Reference in New Issue
Block a user