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.

In my game when I pause the game, I'd like to display three options (Resume, Restart and Menu) so I did this after calling mEngine.stop():

Sprite resume = new Sprite(CAMERA_WIDTH/2, CAMERA_HEIGHT/2, RM.resume, vertex){
            @Override
            public boolean onAreaTouched(TouchEvent event, float pTouchAreaLocalX, float pTouchAreaLocalY) {
                if(event.isActionDown()){
                    this.setScale(1.1f);
                    Log.i("Click","Click");

                }

                return super.onAreaTouched(event, pTouchAreaLocalX, pTouchAreaLocalY);
            }
        };

But the Log "Click" never display. So I tried to do this with the Engine active and the Log displays correctly.

How can I stop my game (Modifier, Physics, Score) without using the mEngine.stop() method ?

share|improve this question
1  
Doesn't the engine gather input? Pausing it would pause input polling too, no? –  Byte56 Aug 18 '13 at 5:28
    
Yes.. But so how I can stop the game (Modifier, Score, Physics) without using this method ? –  Smile Applications Aug 18 '13 at 5:30
    
Maybe that's the question you should ask, instead of "Why?". –  Byte56 Aug 18 '13 at 5:44
1  
It's fine for you now Mister ? –  Smile Applications Aug 18 '13 at 5:49
3  
Just call me Byte, thanks. Mister Byte was my father. –  Byte56 Aug 18 '13 at 7:02
add comment

1 Answer

up vote 2 down vote accepted

You can use public void setIgnoreUpdate(final boolean pIgnoreUpdate); method from the Entity class. The whole Scene is an entity and you attach all objects to it, so if you call scene.setIgnoreUpdate(true) all attached children will stop updating. Of course, you can selectively call this method only on Entities that you wish to pause. onTouch events should still work.

share|improve this answer
    
Thank You so much ! It perfectly works ! –  Smile Applications Aug 18 '13 at 16:31
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.