Add new components: CannotStompComponent, SkillUnlockedComponent, SpaceshipEnterComponent, SpaceshipExitComponent, SpinComponent, StompDamageComponent, StraightMotionComponent, TerrainHitFx, TooltipComponent, TrailComponent, and UnlockOnRequirementComponent
This commit is contained in:
19
scripts/components/StraightMotionComponent.cs
Normal file
19
scripts/components/StraightMotionComponent.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Godot;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
public partial class StraightMotionComponent : Node
|
||||
{
|
||||
[Export] public LaunchComponent LaunchComponent { get; set; }
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
var root = Owner as Node2D;
|
||||
if (root == null || LaunchComponent == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
root.Position += LaunchComponent.GetInitialVelocity() * (float)delta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user