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:
2025-04-18 21:53:50 -03:00
parent ffbbfd455e
commit b0c7c3d3ff
13 changed files with 219 additions and 23 deletions

View File

@@ -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")

View File

@@ -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)