Skip to content

Commit

Permalink
appended messages, keybinds, player colours
Browse files Browse the repository at this point in the history
  • Loading branch information
xxmichaellong committed Dec 20, 2023
1 parent 10cd9a4 commit 28dabd9
Show file tree
Hide file tree
Showing 39 changed files with 683 additions and 247 deletions.
10 changes: 5 additions & 5 deletions back-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ io.on('connection', (socket) => {

const otherPlayerUsernames = otherPlayerInfo.map(([_, player]) => player.username);

socket.on('disconnect', () => {
players.delete(socket.id);
socket.broadcast.to(id).emit('leaveGameMessage', username);
});

if (otherPlayerUsernames.length < 2){
socket.emit('joinGame', otherPlayerUsernames);
socket.broadcast.to(id).emit('joinMessage', username);

socket.on('disconnect', () => {
players.delete(socket.id);
socket.broadcast.to(id).emit('leaveGameMessage', username);
});
} else {
socket.emit('roomReject');
};
Expand Down
5 changes: 5 additions & 0 deletions iframe-containers/opp-containers.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<div id="prizes_html" class="base"></div>
<div id="board_html" class="oppBoard"></div>

<div id="buttonContainer" class="oppButtonContainer">
<button id="vSTARButton">VSTAR</button>
<button id="GXButton" >GX</button>
</div>

<div id="attachedCardPopup_html" class="opp-view">
<div id="attachedCardPopupHeader" class="header opp-header">Opponent moving cards...</div>
<div id="attachedCardPopupButtonContainer" class="opp-button-container">
Expand Down
5 changes: 5 additions & 0 deletions iframe-containers/self-containers.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<div id="prizes_html" class="base"></div>
<div id="board_html" class="selfBoard"></div>

<div id="buttonContainer" class="selfButtonContainer">
<button id="vSTARButton">VSTAR</button>
<button id="GXButton" >GX</button>
</div>

<div id="attachedCardPopup_html" class="self-view">
<div id="attachedCardPopupHeader" class="header self-header">Move attached cards</div>
<div id="attachedCardPopupButtonContainer" class="self-button-container">
Expand Down
81 changes: 43 additions & 38 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,43 @@
<iframe id="oppContainers" class="opp" src="./iframe-containers/opp-containers.html"></iframe>
<div id="stadium_html" class="base"></div>
<div id="selfResizer" class="selfColour"></div>
<div id="oppResizer" class="oppColour"></div>
<div id="boardDivider"></div>

<div id="sideButtonContainer">
<button id="turnButton" class="squareButton">+Turn</button>
<button id="flipCoinButton" class="squareButton">Coin Flip</button>
<button id="vSTARButton" class="squareButton">VSTAR</button>
<button id="GXButton" class="squareButton">GX</button>
<button id="flipBoardButton" class="squareButton">Flip Board</button>
<div id="oppResizer" class="oppColour"></div>

<div id="boardButtonContainer">
<button id="turnButton">+Turn</button>
<button id="flipCoinButton">Coin</button>
<button id="flipBoardButton"></button>
</div>

<div id="topButtonContainer">
<button id="p1Button">1P</button>
<button id="p2Button">2P</button>
<button id="deckImportButton">Import Deck</button>
<button id="settingsButton">Settings</button>
<button id="p1Button" class="selectedPage">1P</button>
<button id="p2Button" class="notSelectedPage">2P</button>
<button id="deckImportButton" class="notSelectedPage">Import Deck</button>
<button id="settingsButton" class="notSelectedPage">Settings</button>
</div>

<div id="p1Box" class="side-box">
<div id="chatbox">Hi! Welcome to ptcg-sim. description incoming.</div>
<div id="p1Box" class="sidebox">
<div id="chatbox"><strong>Welcome to PTCG-sim!</strong><br><br>This is a free tool to practice by yourself or with others. Drag or use keybinds (<span class="shift-font">shift</span>) to play.<br><br>Import your decklist to start testing! 🥳</div>
<div id="chatboxButtonContainer" class="sidebox-button-container">
<button id="attackButton">Attack</button>
<button id="passButton">Pass</button>
<button id="FREEBUTTON">🥳</button>
<button id="attackButton" class="selfColour">Attack</button>
<button id="passButton" class="selfColour">Pass</button>
<button id="FREEBUTTON" class="selfColour">🥳</button>
</div>
<input id="messageInput" type="text" placeholder="Type your message here...">
<div id="bottomP1ButtonContainer" class="sidebox-button-container">
<button id="setupButton">Set Up</button>
<button id="resetButton">Reset</button>
<button id="setupBothButton">Set Up Both</button>
<button id="resetBothButton">Reset Both</button>
<button id="setupButton" class="selfColour">Set Up</button>
<button id="resetButton" class="selfColour">Reset</button>
<button id="setupBothButton" class="neutralColour">Set Up Both</button>
<button id="resetBothButton" class="neutralColour">Reset Both</button>
</div>
</div>
<div id="p2Box" class="side-box">
<div id="p2Box" class="sidebox">
<div id="lobby">
<input id="nameInput" type="text" placeholder="Name">
<div id="roomId">
<input id="roomIdInput" type="text" placeholder="Room ID">
<button id="copyButton">📋</button>
<button id="generateIdButton">Generate ID</button>
<button id="generateIdButton">Generate</button>
</div>
<div id="joinRoomButton"> Join Room </div>
</div>
Expand All @@ -64,23 +61,23 @@
</div>
<div id="p2Chatbox"></div>
<div id="p2ChatboxButtonContainer" class="sidebox-button-container">
<button id="p2AttackButton">Attack</button>
<button id="p2PassButton">Pass</button>
<button id="FREEBUTTON">🥳</button>
<button id="p2AttackButton" class="selfColour">Attack</button>
<button id="p2PassButton" class="selfColour">Pass</button>
<button id="p2FREEBUTTON" class="selfColour">🥳</button>
</div>
<input id="p2MessageInput" type="text" placeholder="Type your message here...">
<div id="p2BottomButtonContainer" class="sidebox-button-container">
<button id="p2SetupButton">Set Up</button>
<button id="p2ResetButton">Reset</button>
<button id="leaveRoomButton">Leave Room</button>
<button id="p2SetupButton" class="selfColour">Set Up</button>
<button id="p2ResetButton" class="selfColour">Reset</button>
<button id="leaveRoomButton" class="neutralColour">Leave Room</button>
</div>
</div>

</div>
<div id="deckImport" class="side-box">
<div id="deckImport" class="sidebox">
<input id="deckImportInput" type="text" placeholder="Import your decklist here..."
></div>
<div id="settings" class="side-box">Settings content...</div>
<div id="settings" class="sidebox">Settings content...</div>


<div id="cardContextMenu" class="contextMenu">
Expand Down Expand Up @@ -120,11 +117,10 @@
</div>

<div id="keybindModal">
<h1>Keybinds</h1>
<div class="sections-container">
<div class="section">
<div class="column">
<h2>Move card...</h2>
<h1>Move card...</h1>
<ul>
<li>to Hand <code>[h]</code></li>
<li>to Discard <code>[d]</code></li>
Expand All @@ -141,7 +137,7 @@ <h2>Move card...</h2>
</ul>
</div>
<div class="column">
<h2>Card actions</h2>
<h1>Card actions</h1>
<ul>
<li>Attach <code>[q]</code></li>
<li>Evolve <code>[e]</code></li>
Expand All @@ -163,23 +159,32 @@ <h2>Card actions</h2>
</div>
<div class="section">
<div class="column">
<h2>Deck</h2>
<h1>Deck</h1>
<ul>
<li>Draw <code>[1-9]</code></li>
<li>Shuffle <code>[s]</code></li>
<li>Draw <code>[1-9]</code></li>
<li>View top <code>[alt + 1-9]</code></li>
<li>View bottom <code>[ctrl + 1-9]</code></li>
<li>View <code>[v]</code></li>
</ul>
</div>
<div class="column">
<h2>General</h2>
<h1>Hand</h1>
<ul>
<li>Discard <code>[alt + d]</code></li>
<li>Shuffle into deck <code>[alt + s]</code></li>
<li>Shuffle to bottom <code>[alt + ↓]</code></li>
</ul>
</div>
<div class="column">
<h1>General</h1>
<ul>
<li>Set up <code>[alt + n]</code></li>
<li>Reset <code>[alt + r]</code></li>
<li>Start turn <code>[alt + t]</code></li>
<li>Flip coin <code>[f]</code></li>
<li>Flip board <code>[alt + f]</code></li>
<li>Mulligan <code>[m]</code></li>
</ul>
</div>
</div>
Expand Down
Loading

0 comments on commit 28dabd9

Please sign in to comment.