Toony Flash game prototype

I want to show you a tiny cute game which is perfect for writing a tutorial about it, and it would also be interesting to port on a mobile device.

I am talking about Toony by Riccardo Amabili and it deserves some minutes of your time, trying to match falling toonies with the ones in your toolbar.

In this post you will find a fully commented script to create a Toony prototype just using functions bound to event listeners.

There are four events which handle entire game:

MOUSE_DOWN: when the mouse is pressed on a toony, will allow the player to drag it

MOUSE_UP: when the mouse is released, it’s time to stop dragging the toony and check whether there’s a match or not

ENTER_FRAME: the main function, used to update toonies position

TIMER: to be called every two seconds, to generate a new toony

And there’s only a MovieClip called Toony which contains four frames, with a different shape in each frame.

This is the script:

and this is the result:

Drag your toonies to match falling toonies and highlight them

Download the source code.

  • You should not mix timer with enterframe event. When flash player is out of focus (other tab or srolled out of view) enterframe gets only about 1 fps. When I scroll up again a bunch of new shapes appear at the top. This would not happen if you make a simple counter in game loop (enterframe).

  • MC

    Cool. I like when you post prototypes and explain the logic behind them, thanks!

  • Pingback: Toony Flash game prototype – Emanuele Feronato « eaflash()

  • Pingback: Illustrate and Animate a Bouncing Ball: Part 1 – Adobe Flash « itechtunes()

  • Hi Emmanuele, am new to programing and highly intrested in game programing, i have some software (maya, macromedia flash 8) & will like to know the exact software it involves in making any of the games listed on this website. I will be glad to receive from you asap. Great work by you there. Thanks sharing your idea. That is called “IMPACT”

  • Hi Emanuele (and everyone else!)

    This article inspired me to create an iPhone game called Squircle:

    http://itunes.apple.com/app/squircle/id521800546?mt=8

    I used a lot of the stuff in your book to help me out, and then added some more advanced features myself…power-ups, bonuses & a scoreboard.

    Take a look and see what you think!

    Happy coding!
    Oisin

  • I like it!

  • Great example.I want to build my first game and didn’t know where to start. This makes it less daunting. I love the way you commented the code so even I can follow!

    Thank you sooooo much