Skip to content

Instantly share code, notes, and snippets.

groupsCalculated: (state) => {
var groups = state.all.reduce((acc, val) => {
if(!acc[val.name]) {
acc[val.name] = {
name: val.name,
id: val.id,
networks: []
};
}
actionFunctions = {
move: function(direction) {
state.location = getLocation(state.location);
}
}
EventRouter = function() {
this.events = {};
}
EventRouter.prototype.subscribe = function(eventName, callback, context) {
if(!this.events[eventName]) {
this.events[eventName] = [];
}
this.events[eventName].push({func: callback, ctx: context});
var path = require('path')
var webpack = require('webpack')
var combineLoaders = require('webpack-combine-loaders')
module.exports = {
entry: './src/vue/main.js',
output: {
path: path.resolve(__dirname, './web/dist'),
publicPath: '/web/dist/',
var electron = require('electron');
var app = electron.app; // Module to control application life.
var BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
// Report crashes to our server.
//require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is GCed.
var mainWindow = null;
Player.prototype.Jump = function(params) {
if( this.state === this.Hurting ||
this.state === this.AttackDiveLand ||
this.state === this.AttackFall ||
this.state === this.Stunned ||
this.state === this.Throwing)
return;
if(params.jump) {
//drop through cloud tiles
<!DOCTYPE html>
<html lang="en">
<head>
<title>p2.js Canvas Box example</title>
<meta charset="utf-8">
<script src="../../build/p2.js"></script>
</head>
<body>
<!-- The canvas, where we draw stuff -->
#pragma strict
public var fadeOutTexture : Texture2D;
var fadeOutRate : float = 0.3;
private var alpha = 0.0;
var delayTimer = 0.00;
static var gameOver = false;
for (var i = 1; i <= 100; i++) {
if (i % 3 === 0) {
document.write("Fizz");
}
if (i % 5 === 0) {
document.write("Buzz");
}
if (i % 3 !== 0 && i % 5 !== 0) {