Designing Game Backgrounds and Layers

Designing Game Backgrounds and Layers
Slide Note
Embed
Share

Dive into the world of game design with a comprehensive guide on creating backgrounds and layers for your projects. Learn techniques such as adding backgrounds, increasing z-position, sorting layers, setting order in layers, creating additional backgrounds, and adding colliders. Master the art of layer management and enhance the visual appeal of your game environments.

  • Game design
  • Backgrounds
  • Layers
  • Visual appeal
  • Techniques

Uploaded on Feb 15, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. LECTURE 8 OUR FIRST PROJECT 13.11.2017 These slides are designed FOR GAME DESIGN CLASS Science AND CULTURE UNIVERSITY By Alireza Seddighi. EMAIL: ALIREZASEDDIGHI@LIVE.COM

  2. ADDING BACKGROUNDS Drag And Drop The Background Sprite From The Sprite Folder Set The Position To (0,0,0) Adjust Orders for sprite There Is Two Way To Set The Proper Order In Layer 1.increasing the z position of the layers 2. sorting layer 3. order in layer

  3. increasing the z position of the layers

  4. 2.Sorting Layer From The Sprite Renderer Choose Sorting Layer And Then Select Add Sorting Layer Click On The + Signe And add two new layers Background and Foreground

  5. 2.Sorting Layer Then select the background for the background sprite and select the foreground for the player sprite

  6. 3.Order in Layer Work exactly like sorting layer but it works for the specific layer or sprite The element in order 0 is going to render behind of the element in order 1 and so on Select the prefab for the player and set order in layer to 2 And select the clouds prefabs and set their order in layer to 1

  7. CREATE OTHER BACKGROUNDS Create An Empty Object And Name It Background & set the position in 0,0,0 Drag the game background as the childe to background object Copy the game background and position it using snap tool (Hold V key)

  8. ADDING BOX COLLIDER TO BACKGROUNDS Select All The Backgrounds And From Add Component Search For Box Collider 2d What The Use Of Collider For Background ? In Order To Move Them We Should Detect Collision

  9. ADDING LAYER CLLICK ON THE LAYER SELECT ADD LAYER CREATE A LAYER CALLED BG SELECT ALL THE BACKGROUNDS AND SET THIRE LAYER TO BG

  10. Whats the use of BG layer? By Going To Edit > Project Setting > Physics 2d We Are Able To Turn Of Other Layer That we don t need to BG to collide with

  11. BG SCALER Create A Folder In Scripts Folder With The Name Of Background Scripts Create New Script With The Name Of BGSclaler Select all the backgrounds and add BGSclaler component to them Open the BGSclaler script and delete Update function

  12. WHAT BGSCALER IS GOING TO DO ? IS GOING TO SCALE THE BACKGROUNDS TO FIT THE CAMERA

  13. CLOUD-COLLECTOR Right Click On The Camera And Create An Empty Object Rename It To Cloud Collectors Then Right Click On The Cloud Collectors And Create 2 Empty Game Objects And Name Them Cloud Collector And Cloud Spawner Select Cloud Collector And Cloud Spawner and from add components add Box Collider 2D By selecting Cloud Collector And Cloud Spawner ,in the Box Collider 2D set x size to 10 and the y size to 0.1 Also set Is trigger checked

  14. TAG THE COLLECTOR AND SPAWNER By selecting Cloud Collector select a color for tagging the object Follow the same steps for Cloud Spawner Set the y position for Cloud Collector to 5.8 Set the y position for Cloud Spawner to -5.8

  15. CLOUD COLLECTORS SCRIPTS Create Cloud Collectors Scripts folder Create CloudCollector scrip and CloudSpawner script Attach CloudCollector scrip to CloudCollector object And Attach CloudSpawner scrip to CloudSpawner object

  16. CloudCollector scrip Create Cloud Collectors Scripts folder For collision detection define the following function In order to define the tags Cloud and Deadly Select the cloud object and from inspector > tag > add tag > + sign > name the tag as Cloud and another tag called Deadly Select all the cloud prefab and change their tag to Cloud and select the Dark Cloud and set it s tag to Deadly

  17. CloudSpawner scrip In the CloudSpawner script define the following variables

More Related Content