Skip to content

Commit

Permalink
Working, mostly tested
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxankey committed Aug 29, 2019
1 parent fd3cdec commit b20e47f
Show file tree
Hide file tree
Showing 92 changed files with 1,156 additions and 746 deletions.
Binary file removed common_images/screenshot.png
Binary file not shown.
11 changes: 11 additions & 0 deletions defaults/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ function scramble_pieces(pieces, x, y, space, scale) {
// Generate all the available grid spots
var spots =[]; for(var n=0; n<pieces.length*space; n++) spots.push(n);

// Pop off the spot under your hand if there is only one die.
if(pieces.length < 2 && spots.length > 1) spots.splice(0,1);

// Set the piece coordinates on the hex grid
for(var n in pieces) {
var p = pieces[n];
Expand All @@ -187,6 +190,14 @@ function scramble_pieces(pieces, x, y, space, scale) {
}
}

/**
* Scramble the selected pieces, like rolling dice: randomizes locations in a pattern determined by the
* last piece's diameter, minimizing overlap.
*/
function scramble_selected_pieces() {
scramble_pieces(board.client_selected_pieces[get_my_client_index()]);
}


/**
* Returns true if x,y is within the box.
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
3 changes: 2 additions & 1 deletion games/arkham/game.js → games/arkham-horror/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ board.collect_r_piece = null; // rotate the piece by the current view when col
board.collect_r_stack = 0; // pieces always stack in the same direction
board.expand_spacing_x = 100;
board.expand_spacing_y = 100;
board.expand_number_per_row = 5;

// Add some teams
board.add_team('white', ['hand_white.png', 'fist_white.png' ], '#cccccc');
Expand Down Expand Up @@ -306,7 +307,7 @@ function select_from_board(pieces) {
function select_players(delay) {select_from_board(character_markers); board.clear_selected_after=delay;}
function select_gates(delay) {select_from_board(gate_tokens); board.clear_selected_after=delay;}
function select_monsters(delay) {select_from_board(monsters); board.clear_selected_after=delay;}
function select_dice(delay) {select_from_board(dice); board.clear_selected_after=delay;}
function select_dice() {board.client_selected_pieces[get_my_client_index()] = [...dice];}
function deselect(delay) {board.client_selected_pieces[get_my_client_index()].length=0;}

function event_keydown(event_data, piece, piece_index) {
Expand Down
178 changes: 178 additions & 0 deletions games/arkham-horror/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<!--
/**
* This file is part of the Virtual Game Table distribution
* (https://github.com/jaxankey/Virtual-Game-Table).
* Copyright (c) 2015-2019 Jack Childress (Sankey).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-->
<!doctype html>
<html>
<head>
<title>Game Table</title>
<style>



body { font: 14px Helvetica, Arial;
padding: 0px;
margin: 0px;}

td { padding: 10px;}

div { display: table;}

canvas{ vertical-align: bottom;}

.tight{ padding: 0px;
border: 0px;
margin: 0px;
margin-bottom: 5px;
width:0%;}

.raised { padding: 5px;
box-shadow: 2px 2px 10px #ccc;
margin: 0px;}

ul.chat {overflow-y: auto;
height: 300px;
font: 14px Helvetica, Arial;}

#messages { list-style-type: none;
margin: 0;
padding: 0; }
#messages li { padding: 5px 5px; }
#messages li:nth-child(odd) { background: #fff5f5; }

ul.clients {overflow-y: auto;
height: 150px;
font: 14px Helvetica, Arial;}

#clients { list-style-type: none; margin: 0; padding: 0; }
#clients li { padding: 5px 5px; }
#clients li:nth-child(odd) { background: #fff5f5; }



/* USER AND CHAT */

.user-container {width: 263px;
margin-bottom: 20px;
position: fixed;
top: 20px;
right: 20px;
background-color: white;}
.chat-container {width: 263px;
position: fixed;
bottom: 20px;
right: 20px;
background-color: white;}

.chat-input {width:210px;}

</style>

<link rel="shortcut icon" type="image/ico" href="images/favicon.ico" />

</head>



<body id="everything">

<canvas id="table" width="580px" height="450px" tabindex="1">
Your browser doesn't support HTML5 canvases. We do all of our testing in
chrome. IE is garbage.
</canvas>


<!-- user box -->
<div id="controls" class="user-container raised">

<table class="tight" style="width:100%">
<tr>

<td class="tight">
<button onclick="board.setup();">Setup</button>
<button onclick="board.tantrum();">Tantrum</button>
</td>
</tr><tr>

<td class="tight" colspan="1">
<b>Table</b>
<a href="/rules.pdf" target="new">Rules</a>
<a href="/controls" target="new">Controls</a>
</td>

</tr>
</table>

<ul id="clients" class="clients"></ul>
</div>



<!-- chat box -->
<div id="chat" class="chat-container raised">
<!-- user info -->
<table class="tight" width="100%"><tr>
<td class="tight">
Name:
<input id="name" onchange="name_onchange()" maxlength=16 autocomplete="off" value="n00b" style="width: 25%"/>
<select id="teams" onchange="team_onchange()"></select>
</td>
</tr>
<tr>
<td class="tight">
<button id="shuffle" onclick="shuffle_selected_pieces(0);">(Z)huffle Selected</button>
<button id="roll" onclick="scramble_selected_pieces();">(R)oll Selected</button>
</td>
</tr>
</table>

<!-- where chat messages will appear -->
<ul id="messages" class="chat"></ul>

<!-- chat area -->
<table class="tight" width="100%"><tr>
<td class="tight">
<form><input id="chat-box" class="chat-input" autocomplete="off" tabindex="2"/><button tabindex="3">Chat</button></form>
</td>
</tr>
<tr>
<td class="tight">
<button id="select_players" onmousedown="select_players(3);">(P)layers</button>
<button id="select_gates" onmousedown="select_gates(3);">(G)ates</button>
</td></tr><tr><td class="tight">
<button id="select_monsters" onmousedown="select_monsters(3);">(M)onsters</button>
<button id="select_dice" onmousedown="select_dice(0);">Dice</button>
</td>
</tr>
</table>



</div>


<!-- libraries -->
<script src="/external_scripts/socket.io.js"></script>
<script src="/external_scripts/jquery.js"></script>

<!-- my scripts -->
<script src="browser.js"></script>
<script src="game.js"></script>

</body>
</html>
Loading

0 comments on commit b20e47f

Please sign in to comment.