Click to See Complete Forum and Search --> : Advice on Flash memory game


RysChwith
12-15-2005, 03:21 PM
Okay, I'm working on creating a memory game in Flash for work, but I'm having a little trouble.

Specifically, I'm trying to work out the following sequence:

1. Select first tile. It has an animated flip to reveal the picture.
2. Select second tile. It also has the animated flip.
3. Wait about half a second.
a. If the tiles match, they disappear and a sidebar slides in from the side.
b. If the tiles do not match, they flip back over (again with the animation).

I'm really close, but I keep running into hitches if you click tiles too quickly, or other minor hiccoughs. I'm starting to think that my entire approach to the problem is flawed.

So my question is this: how would youwork this sequence out? I don't need any code, just the theory you'd use to keep everything running smoothly. I'd like to keep it object-oriented, and in AS 2.0, but I'm willing to try just about anything within those constraints. So how 'bout it?

Rys

mtgentry
12-15-2005, 06:17 PM
This is what I'd do if I had the scripting knowledge it requires :)


Click on card 1, go halfway through the tween and stop.

Click on card 2, go halfway and stop, then see if card 2 matches card 1.
If yes, remove cards from the scene. If no continue both cards in their tween and flip them back over.

What happens when you click too fast?

RysChwith
12-16-2005, 09:12 AM
Well, I've been hesitant to reveal too many details of my own attempt because I want to see how others would tackle it, but the problem with mine comes from intervals. If you click to quickly, you end up with two intervals with the same ID, so that one of them gets effectively "lost" and cannot be cleared. The result is that the affected tiles continue to flip and can't be stopped.

Rys