Files
Arcanum_TD/src/game/entities/projectiles/icicle.ts
T
Mareli 7a62067af1 Initial commit: Arcanum TD — medieval fantasy tower defense
Vite + React + PixiJS + TypeScript. Features:
- 4-level campaign (King's Road → Obsidian Keep)
- Isometric 2.5D grid with ley-line mechanics
- ECS architecture (entities, components, systems)
- 4 tower types, hero spellcaster, 10+ enemy types
- Lich King boss with 3-phase AI
- Meta-progression: essence, rune unlocks
- Full UI redesign with fantasy design system

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:31:49 +03:00

34 lines
1.1 KiB
TypeScript

import { Container, Graphics } from 'pixi.js'
import type { Entity } from '@/game/core/EntityManager'
import type { TransformComp, ProjectileComp, RenderComp } from '@/game/components'
import { getWorldContainer } from '@/game/rendering/WorldContext'
export function createIcicle(
entity: Entity,
startX: number,
startY: number,
targetId: number,
damage: number,
ownerId: number,
): void {
const container = new Container()
const gfx = new Graphics()
gfx.poly([0, -8, -3, 0, 0, 5, 3, 0])
gfx.fill({ color: 0xaaeeff })
gfx.poly([0, -8, -3, 0, 0, 5, 3, 0])
gfx.stroke({ color: 0x6ecbd5, width: 1 })
container.addChild(gfx)
container.x = startX
container.y = startY
getWorldContainer().addChild(container)
Object.assign(entity, {
transform: { x: startX, y: startY, rotation: 0 } as TransformComp,
projectile: { speed: 320, targetId, damage, damageType: 'magic', ownerId, hitRadius: 10, projectileType: 'icicle' } as ProjectileComp,
render: { container, hpBar: null, label: null } as RenderComp,
})
entity.tags.add('projectile')
}