Created
May 10, 2011 01:49
-
-
Save onedayitwillmake/963783 to your computer and use it in GitHub Desktop.
ClosureIssue
This file contains 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
/** | |
File: | |
PerlinNoiseTrait.js | |
Created By: | |
Mario Gonzalez | |
Project : | |
RealtimeMultiplayerNodeJS | |
Abstract: | |
Applies perlin noise to an objects velocity | |
Basic Usage: | |
*/ | |
(function(){ | |
BubbleDots.namespace("BubbleDots.traits"); | |
BubbleDots.traits.PerlinNoiseTrait = function() { | |
BubbleDots.traits.PerlinNoiseTrait.superclass.constructor.call(this); | |
}; | |
BubbleDots.traits.PerlinNoiseTrait.prototype = { | |
displayName : "PerlinNoiseTraitTrait", // Unique string name for this Trait | |
/** | |
* @inheritDoc | |
*/ | |
attach: function(anEntity) { | |
BubbleDots.traits.PerlinNoiseTrait.superclass.attach.call(this, anEntity); | |
this.intercept(['handleAcceleration']); | |
}, | |
/** | |
* Intercepted properties | |
*/ | |
handleAcceleration: (function(){ | |
console.log(this.displayName); | |
return function() { | |
// console.log(ABC123); | |
} | |
})() | |
}; | |
// Extend BaseTrait | |
RealtimeMultiplayerGame.extend( BubbleDots.traits.PerlinNoiseTrait, RealtimeMultiplayerGame.controller.traits.BaseTrait ); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment