Esempio n. 1
0
    // public string LevelFolderPath;

    // Use this for initialization
    void Start()
    {
        LoadLevel levelLoadedCore = GetComponent <LoadLevel>();

        if (levelLoadedCore == null)
        {
            gameObject.AddComponent <LoadLevel>();
            levelLoadedCore = GetComponent <LoadLevel>();
        }

        SimpleLevel LevelGeo = new SimpleLevel(LevelPathGeometry);

        levelLoadedCore.LevelGeometryDictonary = LevelGeometryDictonary;
        levelLoadedCore.SimpleLevel            = LevelGeo;
        SendMessage("loadLevelAndProess");

        SimpleLevel LevelDeco = new SimpleLevel(LevelPathDeco);

        levelLoadedCore.LevelGeometryDictonary = LevelGeometryDictonaryDecoAndAI;
        levelLoadedCore.SimpleLevel            = LevelDeco;
        SendMessage("loadExtraLevelPart");


        // TODO: make this Dynamic and fitting to the current Loaded map

        /*Pathfinder pf = GameObject.Find("Pathfinder").GetComponent<Pathfinder>();
         * pf.MapEndPosition = new Vector2(-200, -200);
         * pf.MapStartPosition = new Vector2(200, 200);*/
    }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            SimpleLevel samplelevel1 = new SimpleLevel(this);

            OptionsMenu optionsScreen = GlobalGameOptions.OptionsMenu;

            MenuScreen menuScreen = new MenuScreen("", true);

            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("", EntryType.Separator, null);

            menuScreen.AddMenuItem("Game Levels", EntryType.Separator, null);
            menuScreen.AddMenuItem(samplelevel1.GetTitle(), EntryType.Screen, samplelevel1);

            menuScreen.AddMenuItem(optionsScreen.MenuTitle, EntryType.Screen, optionsScreen);

            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("Exit", EntryType.GlobalExitItem, null);
            
            ScreenManager.AddScreen(new BackgroundScreen());
            ScreenManager.AddScreen(menuScreen);
            ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(3.0)));
        }
Esempio n. 3
0
 public void MoveActor()
 {
     var playerLocation = SimpleLevel.ActorLocation(SimpleLevel.Player);
     //var result = SimpleLevel.Level.MoveActor(
     //    SimpleLevel.Player.Id, playerLocation.)
 }
Esempio n. 4
0
 public Level(int levelId)
 {
     this.levelId = levelId;
     placedBlocks = new List <Block> ();
     simpleLevel  = new SimpleLevel(levelId);
 }