Dynamic Spot the Difference game
Hi there,
I have recently been looking into making a 'spot the difference' type game that will automatically detect the difference between two similar images.
It will eventually do the following:
1. compare two images
2. detect and separate the differences (hotspots)
3. create clickable movieclips from the separate objects (differences)
So far I have done the following:
1. loaded two images using XML
2. drawn these images into separate BitmapData objects
3. used the 'compare' method of the BitmapData class to detect opaque pixels that are different between the two images
4. created a third BitmapData object containing the differences.
Now, here is where I am stuck...
How would I separate the third BitmapData object (the differences) into individual objects?
I would like to add click functionality to them individually.
I'm pretty sure I need to simplify the objects to black and white blobs and then separate them somehow... I just don't know how.
I have found algorithms such as marching ants, but i am not sure if this is the right approach for this type of application.
Any help would be greatly appreciated. Thanks in advance