1
\$\begingroup\$

I want to create the effect of merging of colours if they are overlapping.

My game is a tile-based game. For all intents and purposes, lets consider a tile from (0,0) to (1,1) in the entire example. A square sprite (lets say red) will start moving from either the diagonal edges, or the centre of the sides and will move to the centre of the tile and fill it.

In this image, 1 red sprite is moving from top centre, and the other one from bottom right. Imagine 2 red blocks moving towards the center

If 2 blocks of the same colour are moving into that tile, and they overlap, they should change the colour, but only of the overlapping area.

enter image description here

Is this possible? If so, with sprites, or do you recommend materials and textures?

Side note: The shape may not necessarily be square. They can be rounded squares, triangles, etc. Also, the red squares may not look so plain. They may have a few inner-shadow and other effects. Also, colour of the 2 blocks might not be the same. E.g.:
Red and black would merge to form orange.

Any suggestions would be great. Phrasing the question was a little tough. Ask me for any details if something was not clear. Thanks in advance :)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.