Skip to content

Instantly share code, notes, and snippets.

Example model

Open any ZIP file exported with spritestack. You will find a model.json there.

{
    "formatVersion": 2,
    "fileType": "SpriteStackModel",
    "parts": [
    {
let options = {
key: fs.readFileSync('./ssl/key.pem', "utf-8"),
cert: fs.readFileSync('./ssl/cert.pem', "utf-8")
};
let httpsServer = https.createServer(options, (req, res) => {
req.socket.end();
});
@rezoner
rezoner / spritestackformat.md
Last active August 15, 2021 14:34
SpriteStack format specs draft

A spritestack model is a ZIP file with two obligatory entries:

package.json

{
    "fileType": "SpriteStackModelProject",
    "title": "Whatever"
}
@rezoner
rezoner / pixel3d-stress-cube.js
Created March 13, 2019 09:54
PIXEL3D work in progress example
/* Code to draw a cube */
function render() {
this.camera.rotation.z += this.elapsed;
for (var x = 0; x < 64; x++) {
for (var y = 0; y < 64; y++) {
for (var z = 0; z < 64; z++) {
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
{
translation: function(tx, ty) {
return [
1, 0, 0,
0, 1, 0,
tx, ty, 1,
];
},
rotation: function(angleInRadians) {
var app = playground({
ready() {
this.loaded = true;
/* Call resize manually if you need to */
this.resize();
},
/* You can reach absolute boundaries of game loop using events API. */
var app = playground({
});
app.on("step", function() {
stats.begin();
@rezoner
rezoner / is_port_taken.js
Created February 4, 2017 12:52
NodeJS is port taken
function isPortTaken(port, fn) {
var net = require('net')
var tester = net.createServer()
.once('error', function(err) {
return fn(err);
})
.once('listening', function() {