Friday, February 27, 2015

Tiles Exchange like Candy Crush

This is a simple program to exchange tiles. Here the use has to click on a tile drag the mouse and release the mouse in the nearby tile(horizontally or vertically). The colors of the tiles gets exchanged.
Here is a snap shot of the program.
It started out as a mesh program and i modified it to have different colors for the tiles. If you want further modification say vary dx,dy,maxx,maxy and choose a texture on the tiles.... as soon as the tiles exchanged form the correct image the game should end. The effort spent in making this game is less than three hours.
Ping me on google chat if you want the source. Will give to anyone interested(123 lines of code). By may end will give out the source on the blog for anyone to download.
Change of mind...====> Here <====is the code for the above project.

I have now found time to develop the project a bit further. I have succeeded in allotting colours such that not more than two squares have the same colour. After that when we exchange the tiles so that three same coloured tiles are in a line they vanish and white space created gets filled by movement of tiles above downwards.
Next i want to implement new tiles created at the top to fill the ones left empty. For now this is what i have done. There are some problems still to be ironed out. It is worthless to mention them here at this point. So download the game from ====> here <====and try to tinker with it.