Skip to content

Instantly share code, notes, and snippets.

@edwinhollen
edwinhollen / pack.json
Created December 11, 2016 03:39
libGDX TexturePacker config in VALID JSON FORMAT
{
"pot": true,
"paddingX": 2,
"paddingY": 2,
"bleed": true,
"edgePadding": true,
"duplicatePadding": false,
"rotation": false,
"minWidth": 16,
"minHeight": 16,
@edwinhollen
edwinhollen / uiskin.json
Created March 2, 2016 14:02
This is the default libGDX uiskin.json file with valid JSON
{
"com.badlogic.gdx.graphics.g2d.BitmapFont": {
"default-font": {
"file": "default.fnt"
}
},
"com.badlogic.gdx.graphics.Color": {
"green": {
"a": 1,
"b": 0,
@edwinhollen
edwinhollen / gist:83511cc9df01f2e7d76a
Created May 14, 2015 20:26
Array.prototype.includes polyfill
if (![].includes) {
Array.prototype.includes = function(searchElement /*, fromIndex*/ ) {
'use strict';
var O = Object(this);
var len = parseInt(O.length) || 0;
if (len === 0) {
return false;
}
var n = parseInt(arguments[1]) || 0;
var k;
@edwinhollen
edwinhollen / gist:5733693
Created June 8, 2013 02:25
Drawing a hexagon in LOVE 2D, based on this wonderful article: http://www.redblobgames.com/grids/hexagons/
hex = {}
hex.centerX = 200
hex.centerY = 200
hex.size = 100
function love.draw()
love.graphics.setColor({255,255,255})
local lastX = nil
local lastY = nil
for i=0,6 do
local angle = 2 * math.pi / 6 * (i + 0.5)