how to make 2 backgrounds? that means when the player goes out of the layout, there is still another background
Develop games in your browser. Powerful, performant & highly capable.
Do you mean the player will continue outside the layout?
You are looking for a continuous scrolling with is one of the numerous items listed in the how do I FAQ.
Look that topic and search within it for the word "Scrolling" you will find all the examples you need.