Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Detecting mouse gestures in Flash with AS3 – Fixed

This is the reprise of an old post about detecting mouse gestures. Since I am making a quick game for my daughter using mouse (or finger gestures), I took the old algorithm and fixed a bug which prevented to correctly detect the up-right movement. Moreover, I optimized a bit the cde to avoid small movement detection.

This is the resut, draw something in the upper left sector:

The theory is fully explained in the original post, at the moment I am optimizing the code zooming the filtered mouse movement in order to achieve more precision when the user draws tiny lines.

This is the source code:

As always you can download the source code. Next time, optimized gesture detection, plus the capability of recognizing simple shapes.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.20 out of 5)
Loading...Loading...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has one comment

  1. Detecting mouse gestures in Flash with AS3 – Fixed – Emanuele Feronato | eaflash

    on March 25, 2013 at 10:50 am

    […] on http://www.emanueleferonato.com Share this:TwitterFacebookLike this:Like […]

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×