End of lesson 31
This commit is contained in:
@@ -3,3 +3,11 @@ extends Mob
|
||||
class_name Player
|
||||
|
||||
@export var camera:Camera2D
|
||||
|
||||
|
||||
func wouldCollideAt(destination):
|
||||
if (super.wouldCollideAt(destination)):
|
||||
#CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
@@ -2,6 +2,8 @@ extends Node2D
|
||||
|
||||
class_name Mob
|
||||
|
||||
@export var health:int = 100
|
||||
|
||||
@export var animator:AnimatedSprite2D
|
||||
|
||||
@export var collisionRay_1:RayCast2D
|
||||
@@ -77,6 +79,4 @@ 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