Beispiel #1
0
 public EditorMover(main main, EditorLevel editor)
 {
     this.main     = main;
     this.location = new Point(1000, 950);
     this.controls = main.getSettings().getControls();
     this.editor   = editor;
 }
Beispiel #2
0
        /* EVENTS */

        private void main_Load(object sender, EventArgs e)
        {
            // TECHNICALS
            this.Location = new Point(10, 10);
            this.Cursor   = new Cursor(Resources.mousepointer.Handle);

            // INITIAL MENU
            menuScreen = "main";

            // LEVEL EDITOR
            editor = EditorLevel.newEditor(this);

            // CINEMATIC
            mode      = Mode.CINEMATIC;
            cinematic = Cinematic.fromString("startup", this);

            // APPLY SETTINGS
            gameSettings = GameSettings.defaultSettings();
            applySettings();

            // CAMPAIGN TEST
            campaign = new List <String>();

            //campaign.Add("main20");
            //campaign.Add("main34");
            //campaign.Add("main35");
            //campaign.Add("main36");
            //campaign.Add("main37");
            //campaign.Add("main38");
            //campaign.Add("main50");
            //campaign.Add("main75");
            //campaign.Add("main76");
            //campaign.Add("main77");
            //campaign.Add("main74");
            for (int i = 0; i < 17; i++)
            {
                campaign.Add("main" + i);
                //campaign.Add("classic" + i);
                //campaign.Add("classic" + (i + 8));
            }
            //campaign.Add("behemoth");
            generateLevel(true);
        }
Beispiel #3
0
        public static Level fromEditor(EditorLevel editor, main main)
        {
            List <Player> playersCopy = new List <Player>();

            foreach (Player p in editor.getPlayers())
            {
                playersCopy.Add(new Player());
            }

            Player[] players = playersCopy.ToArray();

            List <Platform> ps = new List <Platform>();

            foreach (Platform p in editor.getPlatforms())
            {
                ps.Add(new Platform(p.getLocation(), p.getWidth()));
            }
            Platform[] platforms = ps.ToArray();

            List <Sentry> ss = new List <Sentry>();

            foreach (Sentry s in editor.getSentries())
            {
                ss.Add(new Sentry(s.getType(),
                                  s.getDirection() * s.getSpeed(), s.getSecondary()));
            }
            Sentry[] sentries = ss.ToArray();

            int[] key = new int[sentries.Length];

            for (int i = 0; i < key.Length; i++)
            {
                key[i] = editor.getPlatforms().IndexOf(
                    editor.getSentries().ElementAt(i).getPlatform());
            }

            return(new Level(players, platforms, sentries, key,
                             main.getSettings().getFollowMode(), main,
                             editor.name, editor.note));
        }
Beispiel #4
0
 public void resetEditor()
 {
     editor = EditorLevel.newEditor(this);
 }