From 88fb9df5596f2e3892cca09ee1c93432ea0bd8cb Mon Sep 17 00:00:00 2001 From: bymrbanks Date: Fri, 18 Oct 2024 15:13:25 -0500 Subject: [PATCH] sprite adjustments --- components/Map.tsx | 34 +- components/Visualizer.tsx | 14 +- public/entities/rocks.svg | 56 +++ public/map_tiles.svg | 916 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 1005 insertions(+), 15 deletions(-) create mode 100644 public/entities/rocks.svg create mode 100644 public/map_tiles.svg diff --git a/components/Map.tsx b/components/Map.tsx index a5750c7..8d70984 100644 --- a/components/Map.tsx +++ b/components/Map.tsx @@ -7,6 +7,13 @@ export function getCellImage(cell: string) { src="/entities/zombie_alive_1.svg" alt="Zombie" className="w-full h-full" + style={{ + width: '100%', + height: '100%', + position: 'relative', + top: '-20px', + left: '4px', + }} /> ); } @@ -16,17 +23,31 @@ export function getCellImage(cell: string) { src="/entities/player_alive_1.svg" alt="Player" className="w-full h-full" + style={{ + position: 'relative', + top: '-20px', + left: '4px', + }} /> ); } if (cell === "R") { return ( - Block + Block ); } if (cell === "B") { return ( - Block + Block ); } return null; @@ -34,13 +55,8 @@ export function getCellImage(cell: string) { export function Map({ map, size = 64 }: { map: string[][]; size?: number }) { return ( -
- Background Map -
+
+
{map.map((row, y) => (
{row.map((cell, x) => ( diff --git a/components/Visualizer.tsx b/components/Visualizer.tsx index d28e955..59b2112 100644 --- a/components/Visualizer.tsx +++ b/components/Visualizer.tsx @@ -82,12 +82,14 @@ export function Visualizer({ return ( <> -
- Background Map +
{mapState.map((row, y) => (
diff --git a/public/entities/rocks.svg b/public/entities/rocks.svg new file mode 100644 index 0000000..b7e3f28 --- /dev/null +++ b/public/entities/rocks.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/map_tiles.svg b/public/map_tiles.svg new file mode 100644 index 0000000..484dad8 --- /dev/null +++ b/public/map_tiles.svg @@ -0,0 +1,916 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +