make exit collision match more with graphics
This commit is contained in:
parent
aa00590334
commit
a03a1d8f6d
2 changed files with 9 additions and 12 deletions
|
@ -5,7 +5,6 @@ export var cost: int = 0
|
|||
var open: bool = false
|
||||
|
||||
onready var label: Label = $Label
|
||||
onready var detect_shape: CollisionShape2D = $DetectPlayer/CollisionShape2D
|
||||
onready var sprite: Sprite = $Sprite
|
||||
onready var closed_collision: CollisionShape2D = $"%ClosedCollision"
|
||||
|
||||
|
@ -15,11 +14,10 @@ func _ready():
|
|||
func _physics_process(delta):
|
||||
if Game.keys >= cost and not open:
|
||||
open = true
|
||||
detect_shape.disabled = false
|
||||
closed_collision.disabled = true
|
||||
label.visible = false
|
||||
var tween = create_tween()
|
||||
tween.tween_property(sprite, "frame", 3, 0.25)
|
||||
tween.tween_property(closed_collision, "disabled", true, 0.0)
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue