Title transition
This commit is contained in:
20
Levels/Scripts/Door.cs
Normal file
20
Levels/Scripts/Door.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
using Godot;
|
||||
|
||||
public partial class Door : MeshInstance3D
|
||||
{
|
||||
[Export]
|
||||
public AnimationPlayer AnimationPlayer { get; set; }
|
||||
[Export]
|
||||
private int _numberOfHits = 10;
|
||||
|
||||
private void OnDoorHit(Node3D node)
|
||||
{
|
||||
_numberOfHits--;
|
||||
GD.Print(_numberOfHits);
|
||||
AnimationPlayer.Play("HitFlash");
|
||||
|
||||
if (_numberOfHits == 0)
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user