Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Level design 101

Discussion in 'Game Design' started by epochplus5, Nov 21, 2021.

  1. epochplus5


    Apr 19, 2020
    Hi guys,

    Busy building am Asteroids type game, but the camera follows the player around.

    I have a level management system, so level 1 is unlocked and on completion level 2 unlocks etc etc.

    Level 1 is complete. But im having a hard time working out how to manage level enemies destroyed etc etc.

    Currently i have a scene for each level. But on my enemy scripts i have this for example

    Code (CSharp):
    1. LevelOne.ufosDestroyed++;
    This keeps track of how many enemy UFOs have been destroyed to progress to the next stage of the level.
    But the script is pointing to LevelOne script. So is it as simple as having a variable keep track of which level is being played and then having ifs in the Ufo destroyed function saying if its level1 change the variable on that script if its level 2 etc etc. Or should i keep everything in one scene and change scripts there? or is there a better way. Never got this far, its the first time i have ever completed a full level lol
  2. kdgalla


    Mar 15, 2013
    Why do you have a separate script for each level? I'm guessing you want to count the number of UFOs destroyed in every level, so it sounds like you could simply have one script and reuse it for each level.