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.

  • kalekip1

    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.

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

  • Pingback: Dungeon Raid iPhone game engine made with Flash and AS3 – collecting items – Emanuele Feronato « eaflash()

  • Andy C

    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?

  • Hebert P

    Hi emanuele,

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

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

  • Emanuele Feronato

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

  • New Guy

    I can use this source to make my own game ?

    • Emanuele Feronato

      Sure you can!

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