Merge stack

💫 Better miner tile vfx
This commit is contained in:
2025-08-29 17:44:49 +08:00
parent 56cd4c2db2
commit 483773f042
2 changed files with 76 additions and 32 deletions

View File

@@ -40,11 +40,12 @@ public partial class MinerTile : BaseTile
itemPickup.Quantity = 1;
// Initial position (slightly below the spawn point)
const int halfTileSize = GridUtils.TileSize / 2;
var spawnPosition = GridUtils.GridToWorld(_gridPosition);
var targetY = spawnPosition.Y - 27f; // Target Y position
var targetX = spawnPosition.X + 27f + (GD.Randf() * 10f - 5f);
var targetY = spawnPosition.Y - halfTileSize; // Target Y position
var targetX = spawnPosition.X + halfTileSize + (GD.Randf() * 10f - 5f);
itemPickup.Position =
new Vector2(spawnPosition.X + 27f, spawnPosition.Y + 16); // Start below
new Vector2(spawnPosition.X + halfTileSize, spawnPosition.Y + 16); // Start below
itemPickup.Scale = Vector2.Zero; // Start invisible
// Add to the scene