Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Hello 0x72, I have a question, how can I make the character change the color of the skin (since it does not come in the spritesheet)? Also, I did not understand well the way in which the spritesheet is ordered, could you please explain to me. Thank you

(2 edits)

It just maps pixels (lighter: #cccc77, darker: #aaaa55). You can achieve the same (and faster) with a shader  I guess; but here I just do something like:

for(var i=0; i<data.length; i+=4) {
         data[i+0] = replaceColor[0];
         data[i+1] = replaceColor[1];
        data[i+2] = replaceColor[2];

(where components are red, blue and green colors and the 4th one would be alpha)