Page 1 of 1

huller: a tool to generate a collision shape from an image

Posted: Tue Sep 06, 2016 1:10 am
by clofresh

I wrote a small command line tool called huller to generate a collision shape from an image:

The idea is to generate the collision shape outside of your game like this:

Code: Select all

./huller path/to/sprite.png > sprite.lua
And then in your game you can do (assuming you're using HC):

Code: Select all

HC = require('HC')

function love.load()
  spriteShapeData = require('sprite')
  sprite = {
    image ='path/to/sprite.png'),
    shape = HC.polygon(unpack(spriteShapeData)),

function love.draw()