This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
r.ready(); | |
var stars = []; | |
for(var i = 0; i < 500; i++) { | |
stars.push({ |
This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400,400); | |
var cirno = new e2d.Img(); | |
cirno.src = "http://en.touhouwiki.net/images/thumb/d/d5/Th14Cirno.png/235px-Th14Cirno.png"; | |
cirno.on('load', function() { |
This file contains hidden or 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
'use strict'; | |
function Stack() { | |
this.stack = []; | |
this.current = SIMD.Float32x4(1, 0, 0, 1); | |
this.translation = new Float32Array([0, 0]); | |
this.temp = new Float32Array(6); | |
return Object.seal(this); | |
} |
This file contains hidden or 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
'use strict'; | |
function Stack() { | |
this.stack = []; | |
this.current = SIMD.Float32x4(1, 0, 0, 1); | |
this.currentTranslation = SIMD.Float32x4.splat(0); | |
this.temp = new Float32Array(6); | |
return Object.seal(this); | |
} |
This file contains hidden or 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 e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
var windowPosition = [10, 10, 300, 200]; | |
var upperLeftCorner = [e2d.beginPath(), | |
[[0,1], [0,0], [1,0]].map(e2d.moveToLineTo) | |
]; | |
var lowerRightCorner = [e2d.beginPath(), |
This file contains hidden or 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 e2d = require('e2d'); | |
var r = e2d.Renderer.create(800, 600); | |
var dk = new e2d.Img(); | |
dk.src = 'http://archive.kontek.net/smashbros.planets.gamespy.com/images2/ssbmdonkeykong6.jpg'; | |
dk.on('load', function() { r.ready() }); | |
var frame = -1, | |
clickFrame = 0, | |
lastMouseState = 'up'; |
This file contains hidden or 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 e2d = require('e2d'); | |
var soundcloud = require('soundcloud'); | |
soundcloud.initialize({ | |
client_id: 'e01c9af65ee5abd7724350a2f6fc5064' | |
}); | |
!(function streamTrack() { | |
soundcloud.stream('/tracks/106614295').then(function(player){ | |
player.play(); | |
player.on('finish', streamTrack); |
This file contains hidden or 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 p2 = require('p2'), | |
React = require('react'), | |
ReactDOM = require('react-dom'), | |
Chance = require('chance'); | |
var chance = new Chance(); | |
var config = { | |
width: 400, | |
height: 400 | |
}; |
This file contains hidden or 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 e2d = require('e2d'); | |
var p2 = require('p2'); | |
var CollisionGroups = { | |
PLAYER: 1, | |
TERRAIN: 2, | |
BULLETS: 4 | |
}; | |
var world = new p2.World({ gravity: [0,0] }); | |
var forceFactor = 400; | |
var playerRadius = 10; |
This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
var rect = e2d.fillRect(-100,-100,200,200); | |
var redRect = e2d.fillStyle('red', rect); | |
var blueRect = e2d.fillStyle('blue', rect); | |
var greenRect = e2d.fillStyle('green', rect); |