End of lesson 29
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user