complete refactor
This commit is contained in:
parent
65fe0e5c5d
commit
de2e8b1e50
71 changed files with 212 additions and 137 deletions
|
|
@ -1,5 +1,7 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Components.Droppables;
|
||||
|
||||
public partial class DropMover : Node
|
||||
{
|
||||
public float ySpeed = -200.0f;
|
||||
|
|
@ -16,7 +18,7 @@ public partial class DropMover : Node
|
|||
stop_y = ((parent.GlobalPosition / FieldParams.Tile).Ceil() * FieldParams.Tile).Y;
|
||||
gravity = (float)ProjectSettings.GetSetting("physics/2d/default_gravity");
|
||||
|
||||
velocity = new Vector2((GD.Randf()-0.5f)*xSpeed,ySpeed);
|
||||
velocity = new Vector2((GD.Randf() - 0.5f) * xSpeed, ySpeed);
|
||||
}
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
|
|
@ -25,6 +27,6 @@ public partial class DropMover : Node
|
|||
velocity += Vector2.Down * gravity * (float)delta;
|
||||
|
||||
parent.GlobalPosition += velocity * (float)delta;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue