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

Bejeweled AS3 engine with array rotation

I wanted to have a look at a Bejeweled game featuring the 90 degrees array rotation I explained yesterday.

So I took the script made by Brook Jordan in the complete Bejeweled game in less than 2KB – legible version and added some quick and dirty code to make it work:

My code is written mainly at lines 197-218

To save coding time, I only rotate the two-dimensional array, then remove all jewels and recreate them in their new position.

This is the result:

I wonder if it could be interesting to create a real game out of it. Any idea?

No need to download anything, replace the source code of the original prototype with the one on this page.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 3.86 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. baudaffi

    on November 9, 2012 at 7:21 pm

    Try to change the direction of the traspose and try to make the traspose of a minor whit a particolar bonus.

  2. baudaffi

    on November 9, 2012 at 7:22 pm

    Ehm not traspose (my foult) rotation :P

  3. junus

    on November 9, 2012 at 7:35 pm

    I follow your blog more than 2 years, this blog inspire me for many games. I want to say just “thank you” :)

    Also, this game needs smooth collapse effect.

  4. Jae

    on November 9, 2012 at 7:38 pm

    you color scheme is still terribly color blind hating.

  5. alfonsofonso

    on November 9, 2012 at 9:01 pm

    what about a rotate button?

  6. Anup

    on November 9, 2012 at 9:04 pm

    Nice tutorial

  7. Billy Bateman

    on November 10, 2012 at 6:02 am

    I was thinking about maybe doing a twister version of bejeweled. It would be something close to this, I like the concept of rotating the entire board, how about rotating rotating 4 gems to make a match, kinda what I was thinking. Love your site and love the demos.

  8. Bejeweled AS3 engine with array rotation – Emanuele Feronato « eaflash

    on November 12, 2012 at 10:39 am

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

  9. gssgames

    on December 25, 2012 at 10:55 am

    Nice game but it never ends :)

  10. saratogacoach

    on January 30, 2013 at 3:30 pm

    Brilliant tutorial!

    Is there any way to center the gemCanvas (on a bigger,1024X768 stage) and have the selectorBox still work in the new location?