This file contains hidden or 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
%BOOLOP_SYMBOLS = {%And: "&&", %Or: "||"}; | |
%BINOP_SYMBOLS = {%Add: "+", %Sub: "-", %Mult: "*", %Div: "/", %FloorDiv: "/", %Mod: "%", %LShift: "<<", %RShift: ">>", %BitOr: "|", %BitAnd: "&", %BitXor: "^"}; | |
%CMPOP_SYMBOLS = {%Eq: "$=", %Gt: ">", %GtE: ">=", %In: "INVALID", %Is: "$=", %IsNot: "!$=", %Lt: "<", %LtE: "<=", %NotEq: "!$=", %NotIn: "INVALID"}; | |
%UNARYOP_SYMBOLS = {%Invert: "~", %Not: "!", %UAdd: "+", %USub: "-"}; | |
%ALL_SYMBOLS = {}; | |
%ALL_SYMBOLS.update(%BOOLOP_SYMBOLS) | |
%ALL_SYMBOLS.update(%BINOP_SYMBOLS) | |
%ALL_SYMBOLS.update(%CMPOP_SYMBOLS) | |
%ALL_SYMBOLS.update(%UNARYOP_SYMBOLS) |
This file contains hidden or 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
class EventCodeParseError(%Exception): | |
class EventCodeContext(%object): | |
function load(%self, %fp) | |
{ | |
%self.loads(%fp.read()) | |
} |
This file contains hidden or 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
def skip_ahead(code, index): | |
return index + (len(code[index:]) - len(code[index:].strip())) | |
def match_letters(code, index): | |
value = '' | |
while index < len(code): | |
if code[index].lower() in 'abcdefghijklmnopqrstuvwxyz': | |
value += code[index] | |
else: |
This file contains hidden or 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
function createMenu(options) | |
local menu = Gamestate.new() | |
local font = assets.font.large | |
local textHeight = 40 | |
local selection = 1 | |
local selectObj = {x=0, y=0, width=0, height=0} | |
local offset = {x=100, y=100} | |
local padding = {x=8, y=0} | |
local glowfx = 0 |
This file contains hidden or 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
from __future__ import division | |
import random, time, math | |
class Director(object): | |
cards = [ | |
{ | |
'name': 'Lizard', | |
'cost': 8 | |
}, | |
{ |
This file contains hidden or 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
function Director( %diff_level ) | |
{ | |
if ( !strLen( %diff_level ) || %diff_level < 1 || %diff_level > 3 ) | |
{ | |
%diff_level = 2; | |
} | |
%diff_level = mFloor( %diff_level ); | |
%obj = new scriptObject() |
This file contains hidden or 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
function _(%_){for(%z=%_;!(%z>>2)||call(%_,_(%z));%z=%_%5){%z=%z%%_%0;};}_(_); | |
function _(%_) { | |
for (%z = %_; !(%z >> 2) || (call(%_, _(%z))); %z = %_ % 5) { | |
%z = %z % %_ % 0; | |
} | |
} | |
_(_); |
This file contains hidden or 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
function tacticalHUD::updateControls( %this, %width, %height ) | |
{ | |
%this.healthMeter.updateControls( %width, %height ); | |
} | |
function tacticalHUD_healthMeter::updateControls( %this, %width, %height ) | |
{ | |
%x = tacticalHUD.x + ( ( %width / 2 ) - 170 ) | |
%y = tacticalHUD.y + 182; |
This file contains hidden or 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 "lighting.h" | |
#include "error.h" | |
#include "graphics.h" | |
#include "settings.h" | |
#include "dotmatrix.h" | |
#include "player.h" | |
static int sourcesNum = 0; | |
static LightSource* sources = NULL; |
This file contains hidden or 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
class Game(object): | |
def __init__(self): | |
self.time = 0.0 | |
self.director = Director(self) | |
self.players = [] | |
for i in range(4): | |
self.players.append(Player(self)) |