Skip to content

Commit 5457c8a

Browse files
author
kdaon07
committed
캐릭터 방향향
1 parent 6c05627 commit 5457c8a

6 files changed

Lines changed: 58 additions & 8 deletions

File tree

public/player/player_b.svg

Lines changed: 13 additions & 0 deletions
Loading

public/player/player_l.svg

Lines changed: 15 additions & 0 deletions
Loading

public/player/player_r.svg

Lines changed: 15 additions & 0 deletions
Loading

src/Components/Simulator.jsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@ export default function Simulator({array, img, title, direction}) {
88
setItem(img);
99
}, []);
1010

11-
1211
return (
1312
<SimulBg>
1413
<Map>
1514
<tbody>
1615
{array.map((row, rowIndex) => (
1716
<tr key={rowIndex}>
1817
{row.map((cell, cellIndex) => (
19-
<Piece key={cellIndex} img={item[cell]}>{
20-
cell == 0 & direction === "RIGHT" ? '→' :
21-
cell == 0 & direction === "LEFT" ? '←' :
22-
cell == 0 & direction === "UP" ? '↑' :
23-
cell == 0 & direction === "DOWN" ? '↓' : ''
24-
}</Piece>
18+
<Piece key={cellIndex} img={
19+
cell === 0
20+
? direction === "UP"
21+
? item[0.1]
22+
: direction === "LEFT"
23+
? item[0.2]
24+
: direction === "RIGHT"
25+
? item[0.3]
26+
: item[0]
27+
: item[cell]
28+
} />
2529
))}
2630
</tr>
2731
))}

src/Page/Quiz/Plant/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export default function Plant() {
1717

1818
useEffect(() => {
1919
setObject({
20-
0: "/map/player.svg",
20+
0: "/player/player_f.svg",
21+
0.1: "/player/player_b.svg",
22+
0.2: "/player/player_l.svg",
23+
0.3: "/player/player_r.svg",
2124
3: "/map/wall.svg",
2225
1000: "/map/potion.svg",
2326
1001: "/map/tree_wall.svg",

0 commit comments

Comments
 (0)