Home

Awesome

Pixel Sprite Generator

OCaml implementation of a procedural pixel sprite generator similar to the old days of video game sprites. The sprites are algorithmically generated by combinatorial methods.

<img src="https://github.com/fccm/px_sprite_gen/raw/master/img/screenshot-01.png">

Original Project

The original version was written in Javascript:

Algorithm

The sprites are generated by using a two dimensional mask. The values in the mask are then randomized and mirrored.

The algorithm is explained in more detail on Dave Bollinger's website.

Running Examples

opam install graphics
ocaml -I $(ocamlfind query graphics) graphics.cma px_sprite_gen.ml

opam install sdl2
ocaml -I $(ocamlfind query sdl2) sdl2.cma px_sprite_gen_sdl2.ml