2D Continious Background like Metal Slug
Aug 07 2018 05:43 AM
Or you could have the backgrounds already created and the enemies set up and once the player reaches that area the enemies "wake up".
Since the player can't see the next area of the map until the complete the current one, this method is fine.
I am fairly certain that is how Metal Slug does it.
To "erase" your play button, if you are using composer, then in the scene with the play button just insert the button into the sceneGroup:
--wherever play button is sceneGroup:insert(playButton)
This way, the button will disappear as you move into the next scene.
If you are not using composer, and you don't need the button anymore, you can just remove it:
Normally for endless backrounds you will create a couple of copies of the background placing them beside each other. Then you move the background across the screen and when you detect one has moved off screen, you reposition it to other side of the other background. By creating them at the same time, when you add your button later, it will be on top.
If your objects are getting out of order (background on top of the button), you can use the :toBack() API to reorder the object. See: http://docs.coronalabs.com/api/type/DisplayObject/toBack.html