Added locked barriers and a new ghost enemy
This commit is contained in:
23
Levels/Interactables/Silver Barrier.gd
Normal file
23
Levels/Interactables/Silver Barrier.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
extends StaticBody2D
|
||||
|
||||
export var alignment: String = 'V'
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if not alignment in ['V', 'H']:
|
||||
print('Silver Barrier rotation needs to be "V" or "H"')
|
||||
elif alignment == 'H':
|
||||
rotation_degrees = 90
|
||||
return
|
||||
|
||||
|
||||
func _on_unlock_body_entered(body: Node) -> void:
|
||||
if not 'player' in body.get_groups():
|
||||
return
|
||||
|
||||
if body.has_item('Silver Key'):
|
||||
body.remove_item('Silver Key')
|
||||
$Sprite.animation = 'open'
|
||||
$Collision.set_deferred('disabled', true)
|
||||
$Unlock.set_deferred('monitoring', false)
|
||||
return
|
Reference in New Issue
Block a user