Another tinkering with HaxePunk. Some code copied here and there.