Add new components: ExplosiveComponent, FadeAwayComponent, FireEffectComponent, FlipComponent, GravityMotionComponent, LaunchComponent, and update PlatformMovement with LastDirection property

This commit is contained in:
2025-08-10 17:53:06 +02:00
parent ac477115c5
commit 54ffa8a42c
7 changed files with 283 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Godot;
namespace Mr.BrickAdventures.scripts.components;
public partial class LaunchComponent : Node2D
{
[Export] public Vector2 InitialDirection { get; set; } = Vector2.Right;
[Export] public float Speed { get; set; } = 16f;
[Export] public Vector2 SpawnPosition { get; set; } = Vector2.Zero;
[Export] public float SpawnRotation { get; set; } = 0f;
public override void _Ready()
{
if (Owner is not Node2D root) return;
root.GlobalPosition = SpawnPosition;
root.GlobalRotation = SpawnRotation;
}
public Vector2 GetInitialVelocity()
{
return InitialDirection.Normalized() * Speed;
}
}