Creating the environment

To get started, the first thing we'll need to do is add in our backgrounds:

  1. From the Art Assets folder in the example code folder for this chapter, bring the background sprite into the Project tab under the Assets/Sprites folder by dragging and dropping it there.

    Note

    These assets are also created by Kenney, and the art provided in addition to additional plane colors and assets can be found at http://kenney.nl/assets/shooting-gallery.

  2. In this chapter, we will be creating a more detailed environment, which will consist of a sky layer, then a grass layer with three water layers on top of it. I have provided the completed level (StartingMap) for those who want to get started and you can skip to the next section, but for those who wish to know how to assemble the map, you'll need to do the following:
  3. To start this off, bring the bg_blue sprite into the Scene tab and duplicate (Ctrl+D) four of them placing them horizontally away from each other while creating a Background sorting layer and assigning them to it. Then, create an empty game object named Background and place all of those objects inside of it.
  4. Afterwards, create another layer using the two grass textures one after the other, then duplicate and drag it until the area created by the background is filled out. Create an empty game object to hold them all named Grass Layer. Feel free to place some trees up at the top to make it a bit more interesting.
  5. Next, do the same thing as the grass with the water texture provided creating a parent object named Water Row 1. We want to make sure that this object is on top of the grass so change the Z value to -1.
  6. Duplicate the water layer twice by changing the Z values to -2 and -3, respectively, naming them Water Row 2 and Water Row 3.
  7. Finally, select the Main Camera object and zoom the camera in to have a Size of 3.9. Once you're finished, you should have something like this:
    Creating the environment
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset