End of lesson 29

This commit is contained in:
2025-04-18 16:36:11 -03:00
parent 75cbdf40b2
commit 2d87794af9
11 changed files with 87 additions and 7 deletions

View File

@@ -54,3 +54,29 @@ func updateAnimation(direction):
animator.frame = 0
else:
animator.frame += 1
func updateFacing(direction):
var sequence
match(direction):
Map.Direction.East:
sequence = "Idle Right"
Map.Direction.West:
sequence = "Idle Left"
Map.Direction.North:
sequence = "Idle Up"
Map.Direction.South:
sequence = "Idle Down"
animator.animation = sequence
animator.frame = 0
func wouldCollideAt(destination):
updateRaycasts(destination)
if collisionRay_1.is_colliding() || collisionRay_2.is_colliding():
CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
return true