コード例 #1
0
ファイル: LevelLoader.cs プロジェクト: virusmarathe/Portfolio
        public void parseCommands(LinkedList<WorldObject> objects, Menu m)
        {
            String content;
            using (System.Xml.XmlReader r = System.Xml.XmlReader.Create(fileName))
            {
                r.MoveToContent();
                r.ReadToFollowing("objects");
                r.ReadToFollowing("commands");

                content = r.ReadElementContentAsString();
                content = content.Trim();
                r.Close();
            }
            String[] properties = content.Split('\n');
            int[] commandCounter = new int[7];
            if (properties.Length > 1)
            {
                for (int i = 0; i < properties.Length; i++)
                {
                    properties[i] = properties[i].Trim();
                    properties[i] = properties[i].Substring(7);
                    commandCounter[i] = Convert.ToInt32(properties[i]);
                }
                m.setCommandNums(commandCounter);
            }
        }
コード例 #2
0
ファイル: MenuItem.cs プロジェクト: DuncanKeller/Level-Editor
 public MenuItem(string text, Texture2D texture, Vector2 pos, int w, int h, bool selectable, Color c, Menu m, MenuAction a)
 {
     this.text = text;
     this.texture = texture;
     this.pos = pos;
     destination = pos;
     font = TextureManager.FontMap["menuFont"];
     this.m = m;
     action = a;
     this.width = w;
     this.height = h;
     this.c = c;
 }
コード例 #3
0
 public MenuItemBlueprint(string text, Texture2D texture, Vector2 pos, int w, int h, bool selectable, Color c, Menu m, MenuActionS a, string bluePrintName)
     : base(text, texture, pos, w, h, selectable, c, m, delegate() { })
 {
     this.bluePrintName =  bluePrintName;
     action = a;
 }
コード例 #4
0
 public static void OpenLayerMenu()
 {
     current = new LayerMenu();
 }
コード例 #5
0
ファイル: LevelLoader.cs プロジェクト: virusmarathe/Portfolio
 public void parseFile(LinkedList<WorldObject> objects, Texture2D [,] textures, Menu m)
 {
     while (objects.First != null)
     {
         objects.RemoveLast();
     }
     parseStartAndGoal(objects, textures);
     parsePlatforms(objects, textures);
     parseEnemies(objects, textures);
     parseItems(objects);
     parseDoodads(objects, textures);
     parseCommands(objects,m);
     parseRopes(objects);
 }
コード例 #6
0
 public static void OpenEntityMenu(Entity e)
 {
     current = new EntityMenu(e);
 }
コード例 #7
0
 public static void OpenBlueprintMenu()
 {
     current = blueprints;
     blueprints.UpdateMenuItems();
 }
コード例 #8
0
 public static void Close()
 {
     current = null;
 }
コード例 #9
0
 public MenuItemLayer(string text, Texture2D texture, Vector2 pos, int w, int h, bool selectable, Color c, Menu m, LayerAction a, int i)
     : base(text, texture, pos, w, h, selectable, c, m, delegate() { })
 {
     this.index = i;
     action = a;
 }
コード例 #10
0
ファイル: Game1.cs プロジェクト: virusmarathe/Portfolio
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     this.IsMouseVisible = true;
     objects = new LinkedList<WorldObject>();
     highlightRect = new Rectangle(-100, -100, 80, 30);
     palette = new Rectangle(0, 0, SCREEN_WIDTH - 200, SCREEN_HEIGHT);
     gridRect = new Rectangle(0, 0, 10, 10);
     backgroundRect = new Rectangle(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
     menuOpenRect = new Rectangle(0,0,100,70);
     menu = new Menu();
     levelExport = new LevelExporter();
     saveFile = false;
     openFile = false;
     showBounds = false;
     keyDown = false;
     addPlatform = addEnemy = addDoodad = addItem = addHazardousPlatform = addStart = addGoal = addRope = false;
     openMenu = false;
     oldScrollValue = 0;
     newScrollValue = 0;
     xAdd = 0;
     graphics.PreferredBackBufferWidth = SCREEN_WIDTH;
     graphics.PreferredBackBufferHeight = SCREEN_HEIGHT;
     graphics.ApplyChanges();
     zoom_scale = 1;
     base.Initialize();
 }