The idea came by looking at the Game Art Tricks from Simon Schreibt. The code can be improved in many way but the intention was only to have fun :D