Refactor GameManager session state handling and add new components: CanBeLaunchedComponent, IceEffectComponent, JumpPadComponent, KillPlayerOutOfScreenComponent, KnockbackComponent, LifetimeComponent, MagneticSkillComponent, OutOfScreenComponent, PeriodicShootingComponent, PlayerDeathComponent, ProgressiveDamageComponent, ProjectileComponent, ProjectileInitComponent, RequirementComponent, ScoreComponent, ShipMovementComponent, ShipShooterComponent, and SideToSideMovementComponent
This commit is contained in:
18
scripts/components/OutOfScreenComponent.cs
Normal file
18
scripts/components/OutOfScreenComponent.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Godot;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
public partial class OutOfScreenComponent : Node
|
||||
{
|
||||
[Export] public VisibleOnScreenNotifier2D VisibilityNotifier { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
VisibilityNotifier.ScreenExited += OnScreenExited;
|
||||
}
|
||||
|
||||
private void OnScreenExited()
|
||||
{
|
||||
Owner?.QueueFree();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user