This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local buffer = Class {} | |
function buffer:init(size, sort) | |
assert(size ~= nil, "a size is required to create a buffer") | |
self._size = math.max(size or DEFAULT_BUFFER_SIZE, 1) | |
self._items = {} | |
self._sort = sort or function(left, right) return true end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local game = Class {} | |
-- the index of the current player, which is always 1, regardless of how many clients are in array | |
local CURRENT_CLIENT_INDEX = 1 | |
local TICK_RATE = 1/60 | |
local function exitTo(game, nextState) --[[ exit to other scenes ]] end | |
function game:init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local connect = Class { __includes = Scene } | |
function connect:init() | |
Scene.init(self, "CONNECT", textures['background-menu']) | |
end | |
function connect:enter(previous, gameMode, host, port) | |
self.gameMode = gameMode | |
self.clients = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local sock = require '../lib/sock/sock' | |
local bitser = require '../lib/bitser/bitser' | |
PEER_MODE_CLIENT = 'client' | |
PEER_MODE_SERVER = 'server' | |
local peer = Class {} | |
function peer:init(host, port, mode) | |
self.host = host or NET_DEFAULT_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
usage() { | |
cat <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# turn off special handling of ._* files in tar, etc. | |
export COPYFILE_DISABLE=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read .bashrc file if it exists | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi | |
# Add syntax coloring for less, relies on the source-highlight homebrew formula | |
LESSPIPE=`which src-hilite-lesspipe.sh` | |
export LESSOPEN="| ${LESSPIPE} %s" | |
export LESS=' -R -X -F ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include system wide settings which are ignored | |
# by default if one has their own .inputrc | |
$include /etc/inputrc | |
# do not make noise. Also visible can cause delays. | |
set bell-style none | |
# make bash auto–complete case insensitive | |
set completion-ignore-case on |
NewerOlder