How to stop everything happening in a scene

i wanna stop everything first time someone plays the game and show them an image of how to play and when they tap on screen game starts.

i don’t know how to make everything stop

  1. How to pause the game
  2. Create a custom event
1 Like

what do you mean by custom event?

https://docs.cocos2d-x.org/api-ref/creator/v1.5/classes/EventTarget.html

You emit an event that says “everyone stops now”
every node that cares this event should have a script with a subscription to the event and stop(the code of what’s stop means depends of you)

2 Likes

I endorse the way Andres_IC suggested for three reasons:

  1. it favours isolation of concerns, where each object “knows what to do”;
  2. it removes all global responsibility from the main controller class, which would tend to get really messy otherwise;
  3. it focuses on scalability. If you need more objects to react to a simple message (the event in this case), just make the object listen (on/off) to these events.
1 Like

Thanks guys