diff --git a/.gitignore b/.gitignore index 0dd15e9..ce6aa60 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,6 @@ next-env.d.ts *.png !public/**/*.png !src/**/*.png + +# 원본 에셋은 추적 +!assets-src/**/*.png diff --git a/assets-src/README.md b/assets-src/README.md new file mode 100644 index 0000000..e2f6850 --- /dev/null +++ b/assets-src/README.md @@ -0,0 +1,10 @@ +# 원본 에셋 보관소 + +AI로 생성한 원본 이미지. 게임에서 쓰는 최적화본은 `public/assets/`에 있음. + +- `cat-sheets/` — 품종별 6포즈 스프라이트 시트 (2×3: 대기·걷기2·일·요리·잠) +- `textures/` — 잔디·강물 원본 +- `tools/` — 적성별 도구 일러스트 원본 +- `buildings/build_sheet.png` — 건물 4종 시트 (부두·벌목장·채석장·부엌) + +재슬라이스 스크립트는 세션 기록 참조 (연결 성분 기반 배경 제거). diff --git a/assets-src/buildings/build_sheet.png b/assets-src/buildings/build_sheet.png new file mode 100644 index 0000000..935d824 Binary files /dev/null and b/assets-src/buildings/build_sheet.png differ diff --git a/assets-src/cat-sheets/cat_bengal.png b/assets-src/cat-sheets/cat_bengal.png new file mode 100644 index 0000000..ee17a9f Binary files /dev/null and b/assets-src/cat-sheets/cat_bengal.png differ diff --git a/assets-src/cat-sheets/cat_korean.png b/assets-src/cat-sheets/cat_korean.png new file mode 100644 index 0000000..aeb4768 Binary files /dev/null and b/assets-src/cat-sheets/cat_korean.png differ diff --git a/assets-src/cat-sheets/cat_mainecoon.png b/assets-src/cat-sheets/cat_mainecoon.png new file mode 100644 index 0000000..1f64971 Binary files /dev/null and b/assets-src/cat-sheets/cat_mainecoon.png differ diff --git a/assets-src/cat-sheets/cat_munchkin.png b/assets-src/cat-sheets/cat_munchkin.png new file mode 100644 index 0000000..bbd5382 Binary files /dev/null and b/assets-src/cat-sheets/cat_munchkin.png differ diff --git a/assets-src/cat-sheets/cat_norwegian.png b/assets-src/cat-sheets/cat_norwegian.png new file mode 100644 index 0000000..d3ba1d9 Binary files /dev/null and b/assets-src/cat-sheets/cat_norwegian.png differ diff --git a/assets-src/cat-sheets/cat_persian.png b/assets-src/cat-sheets/cat_persian.png new file mode 100644 index 0000000..35bfd64 Binary files /dev/null and b/assets-src/cat-sheets/cat_persian.png differ diff --git a/assets-src/cat-sheets/cat_russian.png b/assets-src/cat-sheets/cat_russian.png new file mode 100644 index 0000000..64cbea9 Binary files /dev/null and b/assets-src/cat-sheets/cat_russian.png differ diff --git a/assets-src/cat-sheets/cat_sphynx.png b/assets-src/cat-sheets/cat_sphynx.png new file mode 100644 index 0000000..0d4d960 Binary files /dev/null and b/assets-src/cat-sheets/cat_sphynx.png differ diff --git a/assets-src/textures/grass.png b/assets-src/textures/grass.png new file mode 100644 index 0000000..d2c9958 Binary files /dev/null and b/assets-src/textures/grass.png differ diff --git a/assets-src/textures/water.png b/assets-src/textures/water.png new file mode 100644 index 0000000..b47b414 Binary files /dev/null and b/assets-src/textures/water.png differ diff --git a/assets-src/tools/axe.png b/assets-src/tools/axe.png new file mode 100644 index 0000000..3d22ecd Binary files /dev/null and b/assets-src/tools/axe.png differ diff --git a/assets-src/tools/brush.png b/assets-src/tools/brush.png new file mode 100644 index 0000000..8356cf7 Binary files /dev/null and b/assets-src/tools/brush.png differ diff --git a/assets-src/tools/fishing_rod.png b/assets-src/tools/fishing_rod.png new file mode 100644 index 0000000..0dfa5f3 Binary files /dev/null and b/assets-src/tools/fishing_rod.png differ diff --git a/assets-src/tools/herb_basket.png b/assets-src/tools/herb_basket.png new file mode 100644 index 0000000..a0a67bf Binary files /dev/null and b/assets-src/tools/herb_basket.png differ diff --git a/assets-src/tools/pickaxe.png b/assets-src/tools/pickaxe.png new file mode 100644 index 0000000..e2b8fe6 Binary files /dev/null and b/assets-src/tools/pickaxe.png differ diff --git a/assets-src/tools/pot_ladle.png b/assets-src/tools/pot_ladle.png new file mode 100644 index 0000000..ebc57e5 Binary files /dev/null and b/assets-src/tools/pot_ladle.png differ diff --git a/assets-src/tools/saw_plank.png b/assets-src/tools/saw_plank.png new file mode 100644 index 0000000..0e47109 Binary files /dev/null and b/assets-src/tools/saw_plank.png differ diff --git a/public/assets/buildings/dock.png b/public/assets/buildings/dock.png new file mode 100644 index 0000000..e657069 Binary files /dev/null and b/public/assets/buildings/dock.png differ diff --git a/public/assets/buildings/kitchen.png b/public/assets/buildings/kitchen.png new file mode 100644 index 0000000..2e4817a Binary files /dev/null and b/public/assets/buildings/kitchen.png differ diff --git a/public/assets/buildings/lumberyard.png b/public/assets/buildings/lumberyard.png new file mode 100644 index 0000000..6131932 Binary files /dev/null and b/public/assets/buildings/lumberyard.png differ diff --git a/public/assets/buildings/quarry.png b/public/assets/buildings/quarry.png new file mode 100644 index 0000000..744471b Binary files /dev/null and b/public/assets/buildings/quarry.png differ diff --git a/public/assets/cats/idle.png b/public/assets/cats/idle.png deleted file mode 100644 index 7ef3049..0000000 Binary files a/public/assets/cats/idle.png and /dev/null differ diff --git a/public/assets/cats/walk1.png b/public/assets/cats/walk1.png deleted file mode 100644 index b6bf8b9..0000000 Binary files a/public/assets/cats/walk1.png and /dev/null differ diff --git a/public/assets/cats/walk2.png b/public/assets/cats/walk2.png deleted file mode 100644 index 9adbec2..0000000 Binary files a/public/assets/cats/walk2.png and /dev/null differ diff --git a/public/assets/cats/work.png b/public/assets/cats/work.png deleted file mode 100644 index 6cce7b2..0000000 Binary files a/public/assets/cats/work.png and /dev/null differ diff --git a/public/file.svg b/public/file.svg deleted file mode 100644 index 004145c..0000000 --- a/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/globe.svg b/public/globe.svg deleted file mode 100644 index 567f17b..0000000 --- a/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/next.svg b/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/vercel.svg b/public/vercel.svg deleted file mode 100644 index 7705396..0000000 --- a/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/window.svg b/public/window.svg deleted file mode 100644 index b2b2a44..0000000 --- a/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/game/Game.tsx b/src/components/game/Game.tsx index 7143e9a..f0d3ed0 100644 --- a/src/components/game/Game.tsx +++ b/src/components/game/Game.tsx @@ -14,6 +14,7 @@ import { APTITUDE_LABEL, BREEDS, BUILD_DEFS, + BUILDING_IMG, catSprite, HALL_LEVELS, KITCHEN_UPGRADE_COST, @@ -199,7 +200,7 @@ export default function Game() { {openedBuilding && ( setPanel(null)} > {/* eslint-disable-next-line @next/next/no-img-element */} {def.name}
{def.name}
diff --git a/src/components/game/VillageView.tsx b/src/components/game/VillageView.tsx index 03328db..8627a23 100644 --- a/src/components/game/VillageView.tsx +++ b/src/components/game/VillageView.tsx @@ -5,6 +5,7 @@ import { engine, catRate, canPlaceAt } from "@/lib/game/engine"; import { BOARD_COLS, BOARD_ROWS, + BUILDING_IMG, catSprite, HALL_TILE, TOOL_IMG, @@ -536,22 +537,29 @@ export default function VillageView({ const stored = Math.floor(b.stored); const isKitchen = b.type === "kitchen"; // 건물 본체 → 정보 패널 - hitRectsRef.current.push({ id: b.id, kind: "open", x: x - 30, y: y - 38, w: 60, h: 66 }); + hitRectsRef.current.push({ id: b.id, kind: "open", x: x - 44, y: y - 52, w: 88, h: 80 }); // 배지 → 빠른 회수 (생산 건물만) if (!isKitchen && stored > 0) hitRectsRef.current.push({ id: b.id, kind: "collect", x: x - 40, y: y - 62, w: 80, h: 26 }); sprites.push({ y, draw: () => { - shadow(x, y + 6, 24); - const img = toolImagesRef.current.get(b.aptitude); - if (img) { - // 세로가 긴 일러스트 — 높이 56px 기준으로 비율 유지 - const h = 56; - const w = (img.width / img.height) * h; - ctx.drawImage(img, x - w / 2, y + 8 - h, w, h); + const bImg = getImage(BUILDING_IMG[b.type]); + if (bImg) { + // 건물 일러스트 (자체 잔디 베이스 포함 — 그림자 불필요) + const w = 96; + const h = (bImg.height / bImg.width) * w; + ctx.drawImage(bImg, x - w / 2, y + 14 - h, w, h); } else { - drawEmoji(b.emoji, x, y + 8, 42); + shadow(x, y + 6, 24); + const img = toolImagesRef.current.get(b.aptitude); + if (img) { + const h = 56; + const w = (img.width / img.height) * h; + ctx.drawImage(img, x - w / 2, y + 8 - h, w, h); + } else { + drawEmoji(b.emoji, x, y + 8, 42); + } } ctx.font = `13px ${juaFamily}`; ctx.textAlign = "center"; @@ -597,14 +605,10 @@ export default function VillageView({ ? "walk1" : "walk2" : "idle"; - // 품종 스프라이트 → (cook 없으면 work) → 기본 스프라이트 순 폴백 + // 품종 스프라이트 → (cook 없으면 work) → 이모지 순 폴백 let sprite = getImage(catSprite(cat.breed, frameName)); if (!sprite && frameName === "cook") sprite = getImage(catSprite(cat.breed, "work")); - if (!sprite) - sprite = getImage( - catSprite("", frameName === "cook" ? "work" : frameName), - ); if (sprite) { const sh = 42; const sw = (sprite.width / sprite.height) * sh; @@ -658,12 +662,14 @@ export default function VillageView({ // 고스트 건물 const gx = isoX(hover.i, hover.j); const gy = isoY(hover.i, hover.j) + TH / 2; - const img = toolImagesRef.current.get(placing.aptitude); + const gImg = + getImage(BUILDING_IMG[placing.type]) ?? + toolImagesRef.current.get(placing.aptitude); ctx.globalAlpha = 0.75; - if (img) { - const h = 56; - const w = (img.width / img.height) * h; - ctx.drawImage(img, gx - w / 2, gy + 8 - h, w, h); + if (gImg) { + const w = 96; + const h = (gImg.height / gImg.width) * w; + ctx.drawImage(gImg, gx - w / 2, gy + 14 - h, w, h); } else { drawEmoji("🏗️", gx, gy + 8, 40); } diff --git a/src/lib/game/data.ts b/src/lib/game/data.ts index 0cc2f13..28e224d 100644 --- a/src/lib/game/data.ts +++ b/src/lib/game/data.ts @@ -23,6 +23,14 @@ export function catSprite(breed: string, frame: CatFrame): string { return dir ? `/assets/cats/${dir}/${frame}.png` : `/assets/cats/${frame}.png`; } +// 건물 일러스트 (public/assets/buildings/) +export const BUILDING_IMG: Record = { + dock: "/assets/buildings/dock.png", + lumberyard: "/assets/buildings/lumberyard.png", + quarry: "/assets/buildings/quarry.png", + kitchen: "/assets/buildings/kitchen.png", +}; + // 적성별 도구 일러스트 (public/assets/tools/) export const TOOL_IMG: Record = { fishing: "/assets/tools/fishing.png",