Setting Up The Game Background

If you don’t know how to change the reference resolution in the game tab, you can learn to do that here.
Next, I am going to create an empty game object in the Hierarchy tab and call it Background Holder. Inside of that game object I am going to create another empty game object and name it Game Background.
Make sure that you set the position values for both Background Holder and Game Background to 0 for X, Y, and Z:



Next, create a new empty game object as the child of the Background Holder, name it Game Ground and set the position values to 0 for all axis.
From the Assets -> Sprites folder, drag the Ground sprite as the child of the Game Ground game object and rename it to Ground 1:

Adding Sorting Layers For The Sprites



If you need to refresh your knowledge why we need to apply these changes to an instance of a prefab, click here.
For the Background 1 game object set its Sorting Layer to Background:


Since the Background and the Ground game objects are both on the Background Sorting Layer, it can happen that the Background will be rendered on top of the Ground, which is not what we want.
When we set the Order in Layer to 1 for the Ground, then it will always be rendered on top of the Background.
You read more about that here.
Creating The Game Level Using The Snap Tool
Now that we have everything set up, we can create the level for our game. We are going to do it by duplicating the Background and the Ground game objects and repositioning them using the snap tool.
If you don’t know how to snap game objects together you can learn about it here.
You can start with the Ground or the Background game object, that is your preference:
You can create your level as large as you want it, that is up to you and it will not affect the outcome of the game.
Just make sure that you position the Background and Ground game objects so that there is no empty gap between them.
This is for the visual part of the game so that it doesn’t look weird, but it will not affect the outcome of the game.
While we are talking about the game visuals, you can also add the Moon sprite in the game and position it wherever you want, just make sure that you set him on the Background Sorting Layer and that the Order in Layer is greater than the one for the Background game objects:

Adding Colliders To Game Objects



We are also going to attach a Rigidbody2D to the Player 1 object so that it applies gravity to the Player 1:

Don’t forget to apply all these changes to the original prefab by clicking the Apply All button:

Also remember that all changes we make to Player 1 game object you should make the same changes to Player 2 game object so repeat the same steps above for Player 2 object.
34 thoughts on “Create A 2D Game With Unity Engine Part 2: Creating The Game Level”
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
kamagra pas cher: kamagra livraison 24h – kamagra en ligne
kamagra 100mg prix: Acheter Kamagra site fiable – acheter kamagra site fiable
pharmacie en ligne france livraison belgique: pharmacie en ligne sans ordonnance – vente de mГ©dicament en ligne pharmafst.com
http://tadalmed.com/# Cialis en ligne
kamagra livraison 24h: Kamagra pharmacie en ligne – Kamagra pharmacie en ligne
Tadalafil sans ordonnance en ligne Tadalafil achat en ligne Acheter Viagra Cialis sans ordonnance tadalmed.com
kamagra pas cher: kamagra 100mg prix – kamagra livraison 24h
https://tadalmed.com/# cialis generique
kamagra pas cher: kamagra livraison 24h – Achetez vos kamagra medicaments
pharmacie en ligne france fiable: Livraison rapide – pharmacie en ligne france livraison internationale pharmafst.com
Achetez vos kamagra medicaments Acheter Kamagra site fiable Kamagra Oral Jelly pas cher
https://pharmafst.com/# п»їpharmacie en ligne france
Cialis sans ordonnance 24h: Acheter Viagra Cialis sans ordonnance – Pharmacie en ligne Cialis sans ordonnance tadalmed.shop
pharmacie en ligne france livraison internationale: Medicaments en ligne livres en 24h – pharmacie en ligne avec ordonnance pharmafst.com
kamagra en ligne: Kamagra pharmacie en ligne – kamagra 100mg prix
https://pharmafst.shop/# pharmacie en ligne sans ordonnance
cialis sans ordonnance: Achat Cialis en ligne fiable – Cialis sans ordonnance 24h tadalmed.shop
achat kamagra kamagra pas cher Achetez vos kamagra medicaments
Acheter Cialis 20 mg pas cher: cialis sans ordonnance – cialis sans ordonnance tadalmed.shop
https://kamagraprix.shop/# Kamagra Commander maintenant
acheter kamagra site fiable: Kamagra pharmacie en ligne – acheter kamagra site fiable
Cialis en ligne: Tadalafil 20 mg prix sans ordonnance – Tadalafil sans ordonnance en ligne tadalmed.shop
pharmacie en ligne sans ordonnance: Livraison rapide – pharmacie en ligne livraison europe pharmafst.com
Kamagra Oral Jelly pas cher kamagra livraison 24h kamagra livraison 24h
http://kamagraprix.com/# kamagra 100mg prix
Kamagra Oral Jelly pas cher: kamagra pas cher – acheter kamagra site fiable
kamagra livraison 24h: Achetez vos kamagra medicaments – Achetez vos kamagra medicaments
kamagra pas cher: Kamagra Oral Jelly pas cher – Acheter Kamagra site fiable
pharmacie en ligne sans ordonnance pharmacie en ligne pas cher pharmacie en ligne france fiable pharmafst.shop
https://pharmafst.com/# pharmacie en ligne france livraison internationale
pharmacie en ligne sans ordonnance: Pharmacies en ligne certifiees – pharmacie en ligne france pas cher pharmafst.com
pharmacie en ligne: Pharmacie en ligne France – pharmacie en ligne livraison europe pharmafst.com
kamagra 100mg prix: Kamagra Commander maintenant – Achetez vos kamagra medicaments