Skip to content

Instantly share code, notes, and snippets.

View schonstal's full-sized avatar

Josh Schonstal schonstal

View GitHub Profile
@schonstal
schonstal / gist:1928378
Created February 28, 2012 01:29
pseudocode example for LordNed
package
{
import org.flixel.*;
public class PlayState extends FlxState
{
private var somethingPrivate:Number = 0;
private var player:Player;
override public function create():void {
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
@schonstal
schonstal / gist:1781595
Created February 9, 2012 17:57
Interval -- Magic?
object interval {
val list = collection.mutable.Map[ Class[_], Double ]()
/** Runs a block at a given interval */
def apply(t:Double, executeNow:Boolean=true)( block : =>Unit) {
val klass = (()=>{block}).getClass
if(list.isDefinedAt(klass)) {
val lastTime = list(klass)
if(util.getSeconds - lastTime >= t) {
function MyClass(config) {
this.initialize(config);
}
MyClass.prototype = {
initialize: function(config) {
//this is the constructor
this._foo = config.foo;
},
herpDerp: function() {