diff --git a/src/App.css b/src/App.css index a495bb6..27e1b0a 100644 --- a/src/App.css +++ b/src/App.css @@ -94,6 +94,22 @@ img { width: 100vw; } +.select-page { + display: flex; + flex-direction: column; + align-items: center; + /* justify-content: center; */ + height: 95vh; + width: 100vw; +} + +.select-page h1 { + font-family: "Uncial Antiqua", sans-serif; + margin: 0px 10px; + font-size: 40px; + /* color: rgb(221, 196, 162); */ +} + .rules-page { display: flex; flex-direction: column; @@ -315,6 +331,18 @@ ul { border: none; } +.controls { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + width: 100%; + height: 60px; + padding: 10px; + margin: 10px; + background-color: rgba(211, 211, 210, 0.2); +} + button { font-family: "Cinzel", cursive; font-weight: 700; diff --git a/src/App.js b/src/App.js index fe8f901..46857c9 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,3 @@ -// import { Outlet } from "react-router-dom"; import { Route, Routes } from "react-router-dom"; import "./App.css"; import NavBar from "./components/NavBar"; @@ -28,9 +27,9 @@ function App() { // } /> - } /> - } /> - } /> + } /> + } /> + } /> diff --git a/src/components/Board.jsx b/src/components/Board.jsx index e0de83c..cc2490a 100644 --- a/src/components/Board.jsx +++ b/src/components/Board.jsx @@ -14,7 +14,7 @@ import { GiChest, } from "react-icons/gi"; -export function Board({ ctx, G, moves, events }) { +export function Board({ ctx, G, moves, events, playerID, isMultiplayer }) { // declare state variables // console.log("gsap", gsap); const [p1Status, setP1Status] = useState(G.messages.p1); @@ -213,10 +213,20 @@ export function Board({ ctx, G, moves, events }) { const movement = player.moveTiles; const action = player.hasDoneAction; const powerup = player.powerup; + const isCurrentPlayer = currentPlayer.name === name; + let isActivePlayer; + if (isMultiplayer) { + console.log("playerID", playerID); + console.log("ctx.currentPlayer", ctx.currentPlayer); + isActivePlayer = + currentPlayer.name === player.name && playerID === ctx.currentPlayer; + } else { + isActivePlayer = isCurrentPlayer; + } return ( -
+

{name === "Quester" ? ( @@ -281,7 +291,7 @@ export function Board({ ctx, G, moves, events }) {

diff --git a/src/components/NavBar.jsx b/src/components/NavBar.jsx index 5388a1e..d3badfa 100644 --- a/src/components/NavBar.jsx +++ b/src/components/NavBar.jsx @@ -17,7 +17,10 @@ const NavBar = () => {
- GAME + PLAY GAME + + + MULTIPLAYER HOW TO PLAY diff --git a/src/pages/Demo.jsx b/src/pages/Demo.jsx index 3a4758f..726d210 100644 --- a/src/pages/Demo.jsx +++ b/src/pages/Demo.jsx @@ -6,11 +6,10 @@ import { Board } from "../components/Board"; const Multiplayer = Client({ game: DungeonThrowdown, - // numPlayers: 2, board: BoardDisplay, + debug: false, + // numPlayers: 2, // multiplayer: SocketIO({ server: "localhost:8000" }), - - // debug: false, }); function BoardDisplay({ G, ctx, moves, events, playerID }) { diff --git a/src/pages/Multiplayer.jsx b/src/pages/Multiplayer.jsx index 067160d..69f2b30 100644 --- a/src/pages/Multiplayer.jsx +++ b/src/pages/Multiplayer.jsx @@ -9,8 +9,7 @@ const Multiplayer = Client({ numPlayers: 2, board: BoardDisplay, multiplayer: SocketIO({ server: process.env.REACT_APP_SERVER }), - - // debug: false, + debug: false, }); function BoardDisplay({ G, ctx, moves, events, playerID }) { @@ -26,7 +25,14 @@ function BoardDisplay({ G, ctx, moves, events, playerID }) { return (

{gameMessage}

- +
); } diff --git a/src/pages/SelectAvatar.jsx b/src/pages/SelectAvatar.jsx index 6fe10ea..202d768 100644 --- a/src/pages/SelectAvatar.jsx +++ b/src/pages/SelectAvatar.jsx @@ -1,15 +1,28 @@ import React from "react"; import { Link } from "react-router-dom"; +import { GiFishMonster, GiSwordwoman } from "react-icons/gi"; const SelectAvatar = () => { return ( -
+

Choose your avatar

- - - - - +
+ + + + + + +
+

+ NOTE: Multiplayer mode is currently under development +

+ +
);