fahad.ibrahim
← All Case Studies
Case Study · v1.0 · Private Repo

Insectiles — sci-fi survival roguelite with a custom PixiJS 8 engine

Built a custom PixiJS 8 game engine from scratch with sci-fi cyberpunk styling, 5 insect classes, wave-based combat, and smooth GSAP transitions. Architecture walkthrough available on request.

PixiJS 8 React 19 TypeScript GSAP Custom Engine Roguelite
5
Insect Classes
Custom
Engine
GSAP
Transitions
Wave
Combat
⚡ Key Decisions

Custom engine over templates: Built from scratch to learn architecture, not configuration. React 19 bridge: UI overlay communicates with engine via typed events, not global state. PixiJS 8 + WebGL: Hardware-accelerated rendering with Canvas 2D fallback. GSAP timelines: Cinematic transitions between game states, not just CSS. TypeScript strict: Engine/UI contract mismatches caught at compile time.

01 The challenge

Most browser games use a prebuilt engine or a template. I wanted to prove I could design and implement a custom game engine from scratch — one that handles rendering, entity management, wave spawning, and state transitions without relying on a black box.

The constraints were tight: React 19 for UI overlay, PixiJS 8 for rendering, TypeScript for type safety across the engine boundary, and GSAP for cinematic transitions. The result needed to feel like a real game, not a tech demo.

02 Custom engine architecture

Instead of fighting PixiJS's scene graph, I built a thin engine layer that owns the game loop, entity lifecycle, and wave orchestration while delegating rendering to PixiJS.

Why custom, not template?

Templates teach you configuration, not architecture. Building a custom engine forced me to make real design decisions: how to handle collision, how to manage entity lifecycles, how to decouple game logic from rendering. Those are the skills that transfer to any complex system.

03 The 5 insect classes

Each class has distinct movement patterns, attack behaviors, and visual identities. Diversity isn't just cosmetic — it changes how players approach each wave.

ClassRoleBehavior
BeetleTankSlow, high HP, charges in straight lines
WaspSkirmisherFast, erratic movement, hit-and-run attacks
AntSwarmLow HP, high numbers, follows pheromone trails
SpiderControllerWeb traps that slow player, ranged attacks
MantisBossMultiple attack phases, pattern-based combat

Each class is a standalone TypeScript module with its own AI state machine. Adding a new class requires implementing the Entity interface and registering it with the wave manager.

04 Rendering & visual style

Sci-fi cyberpunk aesthetic with neon bio-luminescent insects against a dark, atmospheric background. GSAP handles cinematic transitions between states.

Performance-first rendering

Target: 60fps on integrated graphics. Object pooling for projectiles and particles. Spatial partitioning for collision detection. Render batching where possible. Profiled with PixiJS built-in stats.

05 Technical stack

LayerImplementation
EngineCustom PixiJS 8 wrapper
UI OverlayReact 19 + TypeScript
TransitionsGSAP 3.12
LanguageTypeScript strict mode
BuildVite
StateZustand for UI state
React 19 + TypeScript
UI Overlay
HUD / Menus
→
Custom PixiJS 8 Engine
Game Loop
Entity System
→
GSAP 3.12
Transitions + VFX
Zustand State

Insectiles engine: React UI → PixiJS engine → GSAP transitions

06 What's next

The engine is functional but early-stage. Roadmap items:

Honest scope

This is a private repo in active development. The engine architecture is solid, but gameplay depth, balance, and content are early-stage. Not ready for public release yet.

07 What I learned

Building a custom game engine teaches systems thinking that no tutorial can replicate:

All Case Studies GitHub Profile