Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Angry Birds - step by step - Explosive finale

IgnatzIgnatz Mod
edited September 2015 in Examples Posts: 5,396

http://i1303.photobucket.com/albums/ag142/ignatz_mouse/bird_zpsim9i21ti.png

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

Status
Exploding birds finish it off.

Writeup here (with code), video below.

Comments

  • IgnatzIgnatz Mod
    Posts: 5,396

    Updated

  • edited September 2015 Posts: 2,020

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

  • IgnatzIgnatz Mod
    edited September 2015 Posts: 5,396

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

  • Posts: 2,020

    Yes. SetRect's last variable is angle.

  • IgnatzIgnatz Mod
    Posts: 5,396

    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.

  • Posts: 2,020

    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.

  • IgnatzIgnatz Mod
    Posts: 5,396

    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.

  • IgnatzIgnatz Mod
    Posts: 5,396

    Updated

  • terrific, i could study the project and learn much

  • IgnatzIgnatz Mod
    Posts: 5,396

    Updated

  • @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? :)

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

  • IgnatzIgnatz Mod
    Posts: 5,396

    @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

  • Jmv38Jmv38 Mod
    Posts: 3,295

    @ignatz could you provide a public link for

        img=readImage("Dropbox:AngryBirds")
    

    thanks!

  • @Jmv38 You can find it on his second update.

  • Jmv38Jmv38 Mod
    edited September 2015 Posts: 3,295

    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()?

  • IgnatzIgnatz Mod
    Posts: 5,396

    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!

  • IgnatzIgnatz Mod
    Posts: 5,396

    I have one more update, which is for exploding birds (and is interesting when you do it with physics). I wasn't going to post it, because there didn't seem to be much interest, but perhaps I will, now.

  • @Ignatz yes do that, i Love your tutoriel! It is a funny and nice way to learn coding in codea. You do a great job! :)

  • IgnatzIgnatz Mod
    Posts: 5,396

    Update at top

  • Posts: 743

    @Ignatz - superb job! I've really enjoyed seeing it come together.

    As a possible future tutorial I think an interesting topic would be to look at handling levels that are bigger than a single screen. Scrolling and positioning on screen vs "real" world is something I've found challenging in the past.

  • IgnatzIgnatz Mod
    Posts: 5,396

    I think I did that with this project, it's not hard

    https://coolcodea.wordpress.com/2014/09/17/163-2d-platform-game-8-lighting/

  • @Ignatz, is there nothing you can't do? You always seem to be able to do anything you think of, really easily. Like, you're all, "I wanted to see if I could make a naval warfare game," or "I wanted to see if I could make a raytraced racing game with customizable tracks and pathfinding AI," or "I thought I'd just casually duplicate the gameplay of the most successful mobile game of all time as a tutorial for beginners." I find myself in awe. This is really impressive stuff, and you make it look easy.

  • IgnatzIgnatz Mod
    Posts: 5,396

    I can assure you it's not easy. I battle with every step, and rely on a lot of help from anywhere I can find it. And a lot of it is trial and error. I don't write all that down because it's boring, but it certainly is not easy for me, and I'm not setting out to show I'm clever, rather, I'm exploring the limits of what Codea can do and trying to learn new stuff along the way.

    And while Angry Birds may be highly successful, it is made much easier by physics, and the way that Rovio cleverly used that to do all the heavy lifting. There is room for more games like it!

    I think you'll find that if you try your hand at one of these projects, they are a lot of fun, while being challenging.

  • @Ignatz what will you do next? I really looking forward to you next project :) I have learn so much from your tutorials, so thank you!

  • how to get the size of each tiny spirite?

  • @Ignatz Trying to get this running, got this error:

    Objects:32: rect does not intersect image on y axis
    stack traceback:
        [C]: in method 'copy'
        Objects:32: in function 'LoadImages'
        Main:11: in function 'setup'
    

    ...did get the sprite sheet installed correctly btw. I think!

  • IgnatzIgnatz Mod
    Posts: 5,396

    I'll get to it, I'm just busy with other things

  • IgnatzIgnatz Mod
    Posts: 5,396

    It works fine for me, check your image is correct

  • @Ignatz Can you tell me the proper dimensions of the image?

Sign In or Register to comment.