Falling tiles with animated meshes

After all the work done with hit tests and overlapping rectangles I have gone back to a grid system. For some reason I could not do a recording in codea. I used my poor phone to record the video

https://www.dropbox.com/s/w4c8dlkhzsp31o8/VID_20140414_221152.3gp

This looks great! Are you using a separate mesh for each tile?

I was but the performance was too slow when I had over 300 meshes. I use 1 mesh and animate the texture map for the falling tiles. Mesh:setRect for animating them. It works well unless you want to rotate the tiles. Since they are in one mesh and I am not brave enough to tackle 3D for rotations(yet). to Rotate an individual tile a new mesh drawn in it’s place and either move the rect off screen or set the texture map to a transparent area of the atlas.

My next learning step might be to replace the color in the tiles with a shader…Maybe :slight_smile:

If you want to learn about shaders @Ignatz has a PDF on them here

https://www.dropbox.com/s/z05aql3qp3dsly5/Codea%20shaders.pdf

It’s on my list to do for reading. But first timer integration, and the tile class needs to have a list of vec3 for the animated uv map (x,y,duration)