Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm teaching myself andengine while trying to make a match-3 puzzle, so far I have a grid of gems that I populate and can move then around. Matching gems and new gems falling is working already. My problem is that the game keeps flowing while animations runs. How can I make the flow suspend until movement is done?

I use entity modifiers for the gems animations. MoveYModifier for the fall and PathModifier for the swap.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You could override the entity modifier and execute some code at the beginning of the modification and on its end

MoveYModifier yourModifier = new MoveYModifier(3, 0, 10)
{
        @Override
        protected void onModifierStarted(IEntity pItem)
        {
                super.onModifierStarted(pItem);
                // Your action after starting modifier
        }

        @Override
        protected void onModifierFinished(IEntity pItem)
        {
                super.onModifierFinished(pItem);
                // Your action after finishing modifier
        }
};

yourEntity.registerEntityModifier(yourModifier);
share|improve this answer
    
That's exactly what I did, you are kinda late =P. I even forgot about this question. Nonetheless, your anwser is correct, thanks for posting. –  petervaz Nov 26 '12 at 21:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.