Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;
using ClipperLib;
using TriangleNet.Geometry;
using Polygon = System.Collections.Generic.List<ClipperLib.IntPoint>;
using Polygons = System.Collections.Generic.List<System.Collections.Generic.List<ClipperLib.IntPoint>>;
@jonbro
jonbro / readme.txt
Last active January 4, 2016 02:39 — forked from anonymous/readme.txt
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
#include "bhPlacement.h"
float BHPlacement::cx;
float BHPlacement::cy;
// lua accessible functions
BHPlacement::BHPlacement(lua_State *l)
{
}
int BHPlacement::AddPiece(lua_State *l)
@jonbro
jonbro / gist:7803827
Created December 5, 2013 11:27
SLOW CODE :(
local edges = collectEdgePositions(self.rooms.members, self.fingerBlock)
-- for each edge
for i,v in ipairs(edges) do
self.ghostBlock:setPosition(v.p.x, v.p.y)
-- check for overlaps
self.commitParent = v.r
local fudged = false
-- search through each room
self.rooms:updateSpatialHash()
if not self.rooms:overlap(self.ghostBlock, function(a, b)
require 'formula'
class Libgdiplus < Formula
homepage 'http://www.mono-project.com/Libgdiplus'
url 'https://github.com/mono/libgdiplus/archive/2.10.tar.gz'
md5 'bc601912ce8154baf5aa85de51e08b77'
depends_on 'gettext'
depends_on 'libtiff'
depends_on 'libexif'
@jonbro
jonbro / gist:7431874
Created November 12, 2013 14:40
3d tiling system
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GenerateVoxelLevel : MonoBehaviour {
// not going to do octtrees, just totally straight forward arrays so I can get this done in 25 mins
bool[,,] worldMap;
bool[,,] filled;
int[] digPosition;
int worldSize = 40;
@jonbro
jonbro / gist:7372471
Created November 8, 2013 15:18
nanogenmo code version 2
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class MChain {
public class Node {
public string content;
public List<Node> followers; // just duplicate for each follower, make the random pick easier
public Node(string c){
@jonbro
jonbro / gist:7352527
Created November 7, 2013 10:34
markov warmup
spend one fathom all the
difference to defend his skinny fingers; the
air was no vulgar curiosity; because the faces and of yours; he'll do not hear
me; the street, and we debated with her."
"That doesn't agree heartily between my darling's nostrils only
curled the bars upwards like poison!"
@jonbro
jonbro / gist:6353378
Created August 27, 2013 13:16
simplex noise for unity (via tom nullpointer)
private int[] A = new int[3];
private float s, u, v, w;
private int i, j, k;
private float onethird = 0.333333333f;
private float onesixth = 0.166666667f;
private int[] T;
@jonbro
jonbro / gist:6100194
Created July 28, 2013 20:54
unity sprite grid rendering
using UnityEngine;
using System.Collections;
public class renderTiles : MonoBehaviour {
public Vector2 gridSize;
public Vector2 worldSize;
public float perlinScale, timeScale;
public int spriteRow;
public Color hiColor;
public Color lowColor;