feat: projectile system for throwing elements (Phase 4.5)

F key launches first inventory item toward mouse cursor as projectile.
Projectiles travel at 350px/s, expire after 2s, destroyed on hitting
non-walkable tiles. Color matches element's periodic table color.
13 new tests (198 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Денис Шкабатур
2026-02-12 13:29:38 +03:00
parent b097ce738f
commit 0396170303
4 changed files with 404 additions and 11 deletions

View File

@@ -45,3 +45,8 @@ export const Resource = {
quantity: [] as number[], // remaining items to collect
interactRange: [] as number[], // max interaction distance in pixels
};
/** Thrown element/compound projectile */
export const Projectile = {
lifetime: [] as number[], // remaining lifetime in ms (removed at 0)
};