This is a project to make a simple version of Angry Birds in Codea, and develop it step by step in a series of posts in my blog, over a few weeks, to help people who are fairly new with Codea (but have some idea of how to program with it).
@Ignatz the whole point of using spritesheets is that you DON’T split them up into individual images. Convert the table of measurements that you took into texCoords. Then have all your piggies on a single piggy mesh with one image. Animate them by passing the texCoords from the measurement table with setRectTex. This is both simpler and much better performing.
You’re going to have lots of little planks and fragments of scenery though. You might as well introduce rects now, as you’ll need to eventually. I don’t use sprite in anything performance critical, or anything that might become performance critical.
I thought about that, and I agree with using meshes generally, but this is such a small project that I’m trying to keep it simple. As I said, I’ll try it with meshes.
thank you @sky.
note for beginners: you must press the image, save it to your device. Then from codea you must load it to your document assets, from the photo library, check non retina image, name it as you want. Then from ignatz project line of code, touch the image name and pick the image. There you are.
Sprite reads the image from disk every time. readImage loads it into memory so it can be drawn from there - which is much better than reading it from disk sixty times a second!