Last stretch
This commit is contained in:
parent
466a154972
commit
68271c94ed
13 changed files with 338 additions and 99 deletions
27
scripts/entities/Door.cs
Normal file
27
scripts/entities/Door.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using Godot;
|
||||
|
||||
public partial class Door : Node2D
|
||||
{
|
||||
private AnimatedSprite2D _animatedSprite2D;
|
||||
private CollisionShape2D _collisionShape2D;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_animatedSprite2D = (AnimatedSprite2D)FindChild("AnimatedSprite2D");
|
||||
_collisionShape2D = (CollisionShape2D)FindChild("CollisionShape2D");
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
_animatedSprite2D.Play("close");
|
||||
_collisionShape2D.Disabled = false;
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
_animatedSprite2D.Play("open");
|
||||
_collisionShape2D.Disabled = true;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue