Angry Birds - step by step - Explosive finale

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).

Exploding birds finish it off.

Writeup here (with code), video below.


@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.

My pigs need to rotate, too… I will try it, though…

Yes. SetRect’s last variable is angle.

I wasn’t going to worry about that for this project, because you only ever have about 4 pigs in a scene, and this is for relative newbies.

It’s not going to make any difference on this project, but I’ll see how it scales, out of interest.

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.


terrific, i could study the project and learn much


@Ignatz when you are finish with angry bird tutorial, is it possible for you to make a tutorial for a game like Bloons tower Defense 5? :slight_smile:

@llEmill I’ve been working on a basic tower defence game based on BTD5, I might release a small example if you want.

@SkyTheCoder - if you release it, I’ll write it up on my blog if you like.

@SkyTheCoder i would Love to If you could do that

@ignatz could you provide a public link for



@Jmv38 You can find it on his second update.

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.

What is the different If you use sprite() or img=readimage()?

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!