Skip to content

Instantly share code, notes, and snippets.

ready(function(err, socket) {
createGameModel(function(err, game) {
createStage(function(err, stage) {
socket.on('entity.create', function(data) {
game.createEntity(data, function(entity) {
entity.say('hi!');
stage.createSpriteFromEntity(entity, function(sprite) {
// NPC by cmwelsh
//#CLIENTSIDE
client.players = function(players) {
client.on('chat', function(playerID) {
players.get(playerID, function(player) {
player.move(30, 35);
});
});
};
@jamesflorentino
jamesflorentino / convert.sh
Last active September 20, 2016 10:54
Makefile for creating favicons from 16x16 up to 128x128.
convert favicon.png -resize 16x16 favicon.ico;
convert favicon.png -resize 16x16 favicon_16x16.png;
convert favicon.png -resize 32x32 favicon_32x32.png;
convert favicon.png -resize 64x64 favicon_64x64.png;
convert favicon.png -resize 128x128 favicon_128x128.png;
echo "conversion complete";

Macros

Proteins

  • 24g Whey Protein
  • 24g Whey Protein
  • 24g Whey Protein

72g Whey Protein

@jamesflorentino
jamesflorentino / class.js
Created November 27, 2012 20:00
ES5, AMD and CommonJS compliant Class module
/**
* ES5 compliant AMD/CommonJS Class Module
* Copyright (c) 2012 James Florentino
*
* Distributed under the terms of the MIT license.
* http://www.opensource.org/licenses/mit-license.html
*
* Derived from John Resig's Simple Prototype Inheritance http://ejohn.org/
* UMD compatible
*
@jamesflorentino
jamesflorentino / umd-class.js
Created November 18, 2012 01:47
Useable in both CommonJS and AMD
/**
* AMD/CommonJS Class Module
* Copyright (c) 2012 James Florentino
*
* Distributed under the terms of the MIT license.
* http://www.opensource.org/licenses/mit-license.html
*
* Derived from John Resig's Simple Prototypal Inheritance http://ejohn.org/
* UMD compatible
**/
@jamesflorentino
jamesflorentino / outline.md
Created November 7, 2012 23:09
PWDO FFC 2012 James Florentino - From Flash to HTML5

From Flash to HTML5

Introduction

This talk will be mostly about my experience on how I moved from Flash to using HTML5 as a platform for my game which includes libraries that I've used and techniques I've contrived during my learning experience.

I will be using my game, Wings Of Lemuria, as an example for this talk.

<!doctype>
<style>
body {
background: #222;
}
#leaf {
background: green;
border-radius: 130px;
width: 130px;
height: 130px;
@jamesflorentino
jamesflorentino / readme.md
Created October 2, 2012 05:57
Senators of the 15th congress of the Philippines

Senators of the 15th congress of the Philippines

Note: This document is also available in JSON format.

Ed Angara

@jamesflorentino
jamesflorentino / module-template.js
Created September 25, 2012 11:18
Template for defining a JavaScript module.
(function() {
var TestModule = (function() {
function Module() {
/** constructor **/
}
/** prototype methods **/
Module.prototype = {
create : function() {},
read : function() {},