Skip to content

Instantly share code, notes, and snippets.

View rvanzon's full-sized avatar

Richard van Zon rvanzon

View GitHub Profile
@rvanzon
rvanzon / bundle.js
Last active August 29, 2015 14:17
Jay-inheritance + Webpack
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@rvanzon
rvanzon / gist:044f7d0dbbc7bdf04ea2
Created February 23, 2015 06:51
MelonJS ES 6 concept
class Player extends meEntity {
constructor(x, y, settings) {
super(x, y, settings);
}
update(dt) {
super.update(dt);
}
onCollision(a, b) {
return false;
}
@rvanzon
rvanzon / gist:ea17d4bd6c1437d821a2
Last active August 29, 2015 14:15
CollisionStateEntity for MelonJS
game.CollisionStateEntity = me.Entity.extend({
init: function(x, y, settings) {
this._super(me.Entity, 'init', [x, y , settings]);
this.entitiesInside = {};
this.entitiesInsideThisFrame = {};
},
update: function (dt) {
@rvanzon
rvanzon / gist:442f16ea7db5f7b03fc3
Created July 16, 2014 08:38
RHashManager, connect location.has to CPNotificationCenter
//
// RHashManager
// by Richard van Zon (c) Relectus
//
// Public Domain
//
@import <Foundation/CPObject.j>
var sharedHashManager = nil;
@rvanzon
rvanzon / gist:5063439
Last active December 14, 2015 09:18
Adding performSelector:withObject:afterDelay:aDelay to the Objective-J Foundation
@implementation CPObject(delayedSelectorPerforming)
{
}
- (void)performSelector:(SEL)aSelector withObject:(id)anObject afterDelay:(CPTimeInterval)aDelay
{
setTimeout(function() { objj_msgSend(self, aSelector, anObject); }, aDelay * 1000);
}
@end