Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Dungeon Raid iPhone game engine made with Flash and AS3 – collecting items

Here we are with the 3rd step of the tutorial. Today we will let the player collect items if he selects at least three of them with the same color.

The changes to be made to the script are very simple. First we need another property in tileObject object called val, an integer which will range from 1 to 6.

This will allow us to create six different kind of tiles, which must be represented by as may frames in Tile symbol. I used six different colors.

Then, a valid move is defined as a move which groups at least three tiles oft he same color, so if the player performs a valid move, selected tiles are removed from the stage and new ones appear, this way:

Tiles do not fall down like in the original game, but you should be able to do it since it’s the same concept used during the making of Bejeweled.

Here is the source code:

And you can download the entire project here.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 10 comments

  1. kalekip1

    on July 24, 2012 at 6:44 pm

    You always make nice tutorials, I have 2 questions.

    First of all, people learn better by watching movies (YouTube tutorials for example).

    And did you make this feedback form yourself? I’d like to get the source, or at least a tutorial on how to make it using PHP.

    Thanks, your tutorials are awesome, even that I don’t use AS, I like them.

  2. lewis

    on July 24, 2012 at 7:47 pm

    I am going do download myself the project and see more closely how it works.

  3. Dungeon Raid iPhone game engine made with Flash and AS3 – collecting items – Emanuele Feronato « eaflash

    on July 25, 2012 at 11:32 am

    [...] on http://www.emanueleferonato.com Share this:TwitterFacebookLike this:LikeBe the first to like [...]

  4. Andy C

    on July 26, 2012 at 12:47 pm

    Fantastic code, thanks for sharing. Not having played Dungeon Raid, I am wondering how to add new coins once a group has been collected that means the game doesn’t eventually stop because there are no more groups of three – or does that happen in Dungeon Raid too?

  5. Hebert P

    on July 28, 2012 at 5:52 am

    Hi emanuele,

    Any news about your box2D book?
    When is the release?
    I’m crazy to read this book (really, I’m crazy!).

  6. Giochi di guerra flash online

    on July 30, 2012 at 11:23 am

    Great code! I’m starting studying it right now, loving it! Thanks for the great share!

  7. Emanuele Feronato

    on July 30, 2012 at 11:38 pm

    @Hebert: currently it’s under technical review, I think it will be released before summer ends

  8. New Guy

    on September 3, 2012 at 3:33 am

    I can use this source to make my own game ?

  9. Emanuele Feronato

    on September 3, 2012 at 11:33 am

    Sure you can!

  10. Andrew

    on September 9, 2012 at 4:10 pm

    Thanks for the code. It’s great. I’m studying it right now.