various components offering game-shell's functionality as standalone modules.
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> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
</style> | |
</head> |
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
const unindex = require('unindex-mesh') | |
const normals = require('face-normals') | |
const glsl = require('glslify') | |
const regl = require('regl')({ extensions: ['ANGLE_instanced_arrays'] }) | |
const cube = unindex(require('primitive-cube')()) | |
const camera = require('regl-camera')(regl) | |
const { translations, scales } = generateSplitGrid() |
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
float sSphere(vec3 p, float time) { | |
return length(p) - 1.0 - noise(p, time) * 0.05; | |
} | |
vec3 calcNormal(vec3 p, float time) { | |
const float eps = 0.002; | |
const vec2 offset = vec2(1.0, -1.0); | |
return normalize( | |
offset.xyy * sSphere(p + offset.xyy * eps, time) + |
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 clone = require('clone') | |
var uniq = require('uniq') | |
var raf = require('raf') | |
var xhr = require('xhr') | |
var s = 200 | |
var t = 250 | |
xhr({ | |
uri: 'http://www.corsproxy.com/bl.ocks.org/mbostock/raw/4090846/world-110m.json' | |
, json: 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
// the base module | |
module.exports = function(canvas){ | |
if('string' == typeof canvas) canvas = dcoument.getElementById(canvas) | |
touchdown.start(canvas) | |
var ctx = window.ctx = canvas.getContext('2d') | |
var pen = basic(ctx) | |
ctx.translate(0.5, 0.5) | |
ctx.lineWidth = 10 | |
ctx.globalCompositeOperation = 'destination-over'; |
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
// This version is unminified | |
var observer = require('continuous-observer') | |
var cave = require('cave-automata-2d') | |
var fill = require('ndarray-fill') | |
var zero = require('zeros') | |
var raf = require('raf') | |
var canvas = document.createElement('canvas') | |
var ctx = canvas.getContext('2d') |
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 render = require('ndarray-text') | |
var zeros = require('zeros') | |
var cave = require('cave-automata-2d') | |
var pre = document.createElement('pre') | |
// Create an empty ndarray, | |
// 60 units wide and | |
// 18 units high | |
var array = zeros([60, 18]) | |
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 render = require('ndarray-canvas') | |
var zeros = require('zeros') | |
var cave = require('cave-automata-2d') | |
var fill = require('ndarray-fill') | |
var canvas = document.createElement('canvas') | |
// Create an empty ndarray, | |
// 60 units wide and | |
// 18 units high | |
var array = zeros([500, 300]) |
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 observer = require('continuous-observer') | |
var topdown = require('topdown-physics') | |
var cave = require('cave-automata-2d') | |
var fill = require('ndarray-fill') | |
var aabb = require('aabb-2d') | |
var zero = require('zeros') | |
var raf = require('raf') | |
var canvas = document.createElement('canvas') | |
var ctx = canvas.getContext('2d') |
NewerOlder