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
<!DOCTYPE html> | |
<meta charset="UTF-8"> | |
<html> | |
<head> | |
<title>Demo</title> | |
<script language = 'javascript' src = "../examples/js/THREE-r72.js" type = 'text/javascript'></script> | |
<script type="text/javascript" src="../src/SPE.js"></script> | |
<script type="text/javascript" src="../src/helpers/SPE.TypedArrayHelper.js"></script> | |
<script type="text/javascript" src="../src/helpers/SPE.ShaderAttribute.js"></script> | |
<script type="text/javascript" src="../src/shaders/SPE.shaderChunks.js"></script> |
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
particleTexture = this.params.map ? ENGINE.loadCachedTexture('/img/particles/' + this.params.map + '.png') : null; | |
particleArray = ENGINE.mc.get('particleArray'); | |
this.particleGroup = new SPE.Group({ | |
texture: particleTexture, | |
fog: true | |
}); |
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
<body> | |
<script type="text/javascript"> | |
var context = new webkitAudioContext(); | |
destination = context.destination, | |
osc = context.createOscillator(), | |
lfo = context.createOscillator(), | |
lfoGain = context.createGainNode(), | |
filter = context.createBiquadFilter(); | |
osc.type = osc.TRIANGLE; |
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
var exec = require('child_process').exec, | |
child = exec('node [PATH-TO-YOUR-KEEP-ALIVE-NODE-FILE]'); | |
console.log('child pid: ' + child.pid); | |
exec('ps aux | grep node', function(err, stdout) { | |
console.log(stdout); | |
}); |
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
// If jump key is pressed, toggle the isJumping property, reset the | |
// jumpSinPos to zero, and set the y position. | |
if(keyHandler.isKeyPressed('space') && !this.isJumping) { | |
this.vel.y = 0; | |
this.jumpSinPos = 0; | |
this.isJumping = true; | |
this.jumpStartPos = this.pos.y; | |
} | |
// If we're jumping, move along the sine wave. |
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
// Try putting this in your touchstart... | |
// Where 'e' is your event. | |
var that = this, | |
point = e.changedTouches[0], | |
target; | |
target = document.elementFromPoint(point.pageX, point.pageY); | |
if(target.nodeType === 3) target = target.parentNode; |