Loading...
Loading...
Expert skill for building pixel art idle/incremental games with procedural sprite generation, React/TypeScript/Zustand architecture, and contemplative game design. Use when creating pixel art games, implementing idle game mechanics, generating procedural sprites via Canvas API, building collection-based games, or implementing incremental game economies. Triggers on requests for pixel art, idle games, sprite generation, incremental games, collection games, or contemplative game experiences.
npx skill4agent add cooksaw/claude-skills pixel-art-game-builder| Need | Go to |
|---|---|
| Start a new project | Quick Start |
| Copy working code | templates/ |
| Understand patterns | patterns/ |
| See full example | examples/ |
| Deep reference | references/ |
| CSS/Tailwind setup | assets/ |
npm create vite@latest my-idle-game -- --template react-ts
cd my-idle-game
npm install zustand immer
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p// MANDATORY for pixel-perfect rendering
ctx.imageSmoothingEnabled = false;/* CSS for any sprite element */
.sprite { image-rendering: pixelated; }const PALETTE = {
deepBlack: '#0a0a0f', // Main background
spaceGray: '#1a1a2e', // Panels
borderGray: '#2d2d44', // Borders
neonCyan: '#00fff5', // Primary actions, RARE
softMagenta: '#ff6bcb', // Notifications, EPIC
cosmicGold: '#ffd93d', // Rewards, LEGENDARY
validGreen: '#39ff14', // Success, UNCOMMON
alertRed: '#ff4757', // Alerts (rare use)
mysteryPurple: '#6c5ce7', // Hidden/secret
mainWhite: '#e8e8e8', // Body text, COMMON
secondaryGray: '#a0a0a0', // Disabled
interactiveCyan: '#7fefef' // Links
};
const RARITY_COLORS = {
common: PALETTE.secondaryGray,
uncommon: PALETTE.validGreen,
rare: PALETTE.neonCyan,
epic: PALETTE.softMagenta,
legendary: PALETTE.cosmicGold,
};useEffect(() => {
const interval = setInterval(() => {
const now = Date.now();
const delta = (now - lastTick) / 1000;
// Update resources
addCredits(incomePerSecond * delta);
regenerateEnergy(delta);
setLastTick(now);
}, 100);
return () => clearInterval(interval);
}, [incomePerSecond, lastTick]);import { create } from 'zustand';
import { persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
const useGameStore = create<GameState>()(
persist(
immer((set, get) => ({
credits: 0,
energy: 100,
addCredits: (amount) => set((s) => { s.credits += amount }),
})),
{ name: 'game-save' }
)
);| Template | Description |
|---|---|
| Hook for 100ms game tick with delta time |
| Zustand persist pattern with migration |
| Scaling formulas (exponential costs, diminishing returns) |
| Canvas component with pixel-perfect rendering |
| Pattern | Description |
|---|---|
| Structure currencies, caps, regeneration |
| Linear upgrades, skill trees, prestige unlocks |
| Reset mechanics, meta-progression, permanent bonuses |
| Generate varied sprites from seeds |
| Example | Description |
|---|---|
| Complete ~150 line idle game with resources, upgrades, save |
| Reference | When to use |
|---|---|
| Full project structure, types, stores |
| Canvas API, color derivation, caching |
| Economy, scanning, progression formulas |
| Components, layouts, animations |
| Data structure for items, sectors, upgrades |
| Metric | Target |
|---|---|
| Bundle size | <200KB gzipped |
| FPS idle | ≥30 |
| Memory | <100MB |
imageSmoothingEnabled = false