コード例 #1
0
ファイル: Game1.cs プロジェクト: idickson0/Toggle
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Associate names in the dictionary with the graphics
            for (int x = 0; x < Textures.graphicNames.Length; x++)
            {
                Textures.textures.Add(Textures.graphicNames[x], Content.Load <Texture2D>(Textures.graphicNames[x]));
            }

            KittenZombie    kt = new KittenZombie(400, 300, worldState);
            FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);

            //creatures.Add(kt);
            for (int i = 0; i < 5; i++)
            {
                for (int y2 = 0; y2 < 5; y2++)
                {
                    kt = new KittenZombie(i * 35, 5 + (y2 * 35), worldState);
                    ft = new FlowerTentacles(5 + (i * 35), (y2 * 35) + 230, worldState);
                    creatures.Add(kt);
                    creatures.Add(ft);
                }
            }
            player = new Player(700, 300, worldState);
            creatures.Add(player);

            /*FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);
             * creatures.Add(ft);
             *
             * ft = new FlowerTentacles(300, 350, worldState);
             * creatures.Add(ft);*/

            GreenBlock b = new GreenBlock(250, 300, worldState);

            items.Add(b);

            song  = Content.Load <Song>("whitesky");
            song2 = Content.Load <Song>("climbing_up_the_walls");
            MediaPlayer.Play(song);
            //MediaPlayer.IsRepeating = true;
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: ripark/Toggle
        protected override void LoadContent()
        {
            width  = GraphicsDevice.PresentationParameters.Bounds.Width;
            height = GraphicsDevice.PresentationParameters.Bounds.Height;
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Associate names in the dictionary with the graphics
            for (int x = 0; x < Textures.graphicNames.Length; x++)
            {
                Textures.textures.Add(Textures.graphicNames[x], Content.Load <Texture2D>(Textures.graphicNames[x]));
            }

            for (int x = 0; x < Textures.tileNames.Length; x++)
            {
                Textures.textures.Add(Textures.tileNames[x], Content.Load <Texture2D>("Tile/" + Textures.tileNames[x]));
            }

            //KittenZombie kt = new KittenZombie(400,300,worldState);
            //FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);
            //creatures.Add(kt);

            /*
             * for (int i = 0; i < 5; i++ )
             * {
             *  for (int y2 = 0; y2 < 5; y2++)
             *  {
             *      kt = new KittenZombie(i * 35, 5 + (y2 * 35), worldState);
             *      ft = new FlowerTentacles(5 + (i * 35),(y2 * 35) + 230, worldState);
             *      creatures.Add(kt);
             *      creatures.Add(ft);
             *  }
             * }
             * */
            inventory = new Inventory(300, 300);
            player    = new Player(32 * 19, 32 * 5, worldState, inventory, this);
            creatures.Add(player);

            FlowerTentacles ft = new FlowerTentacles(32 * 11, 32 * 4, worldState);

            creatures.Add(ft);
            ft.setDefendTileGood(11, 4);
            ft.setDefendTileBad(11, 7);

            ft = new FlowerTentacles(32 * 12, 32 * 4, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(12, 4);
            ft.setDefendTileBad(12, 6);

            ft = new FlowerTentacles(32 * 12, 32 * 11, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(12, 11);
            ft.setDefendTileBad(13, 7);

            ft = new FlowerTentacles(32 * 11, 32 * 11, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(11, 11);
            ft.setDefendTileBad(12, 8);


            //ft = new FlowerTentacles(500, 400, worldState);
            //creatures.Add(ft);

            GreenBlock b = new GreenBlock(32 * 12, 32 * 7, worldState);

            items.Add(b);

            song  = Content.Load <Song>("whitesky");
            song2 = Content.Load <Song>("climbing_up_the_walls");

            MediaPlayer.Play(song);
            makeMapFromFile("home.txt");
            //MediaPlayer.IsRepeating = true;
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: idickson0/Toggle
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Associate names in the dictionary with the graphics
            for (int x = 0; x < Textures.graphicNames.Length; x++)
            {
                Textures.textures.Add(Textures.graphicNames[x], Content.Load<Texture2D>(Textures.graphicNames[x]));
            }

            KittenZombie kt = new KittenZombie(400,300,worldState);
            FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);
            //creatures.Add(kt);
            for (int i = 0; i < 5; i++ )
            {
                for (int y2 = 0; y2 < 5; y2++)
                {
                    kt = new KittenZombie(i * 35, 5 + (y2 * 35), worldState);
                    ft = new FlowerTentacles(5 + (i * 35),(y2 * 35) + 230, worldState);
                    creatures.Add(kt);
                    creatures.Add(ft);
                }
            }
            player = new Player(700, 300, worldState);
            creatures.Add(player);

            /*FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);
            creatures.Add(ft);

            ft = new FlowerTentacles(300, 350, worldState);
            creatures.Add(ft);*/

            GreenBlock b = new GreenBlock(250, 300, worldState);
            items.Add(b);

            song = Content.Load<Song>("whitesky");
            song2 = Content.Load<Song>("climbing_up_the_walls");
            MediaPlayer.Play(song);
            //MediaPlayer.IsRepeating = true;
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: ripark/Toggle
        protected override void LoadContent()
        {
            width = GraphicsDevice.PresentationParameters.Bounds.Width;
            height = GraphicsDevice.PresentationParameters.Bounds.Height;
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Associate names in the dictionary with the graphics
            for (int x = 0; x < Textures.graphicNames.Length; x++)
            {
                Textures.textures.Add(Textures.graphicNames[x], Content.Load<Texture2D>(Textures.graphicNames[x]));
            }

            for(int x = 0; x < Textures.tileNames.Length; x++)
            {
                Textures.textures.Add(Textures.tileNames[x], Content.Load<Texture2D>("Tile/" + Textures.tileNames[x]));
            }

            //KittenZombie kt = new KittenZombie(400,300,worldState);
            //FlowerTentacles ft = new FlowerTentacles(600, 250, worldState);
            //creatures.Add(kt);
            /*
            for (int i = 0; i < 5; i++ )
            {
                for (int y2 = 0; y2 < 5; y2++)
                {
                    kt = new KittenZombie(i * 35, 5 + (y2 * 35), worldState);
                    ft = new FlowerTentacles(5 + (i * 35),(y2 * 35) + 230, worldState);
                    creatures.Add(kt);
                    creatures.Add(ft);
                }
            }
             * */
            inventory = new Inventory(300, 300);
            player = new Player(32*19, 32*5, worldState, inventory, this);
            creatures.Add(player);

            FlowerTentacles ft = new FlowerTentacles(32*11, 32*4, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(11, 4);
            ft.setDefendTileBad(11, 7);

            ft = new FlowerTentacles(32 * 12, 32 * 4, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(12, 4);
            ft.setDefendTileBad(12, 6);

            ft = new FlowerTentacles(32 * 12, 32 * 11, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(12, 11);
            ft.setDefendTileBad(13, 7);

            ft = new FlowerTentacles(32 * 11, 32 * 11, worldState);
            creatures.Add(ft);
            ft.setDefendTileGood(11, 11);
            ft.setDefendTileBad(12, 8);

            //ft = new FlowerTentacles(500, 400, worldState);
            //creatures.Add(ft);

            GreenBlock b = new GreenBlock(32*12, 32*7, worldState);
            items.Add(b);

            song = Content.Load<Song>("whitesky");
            song2 = Content.Load<Song>("climbing_up_the_walls");

            MediaPlayer.Play(song);
            makeMapFromFile("home.txt");
            //MediaPlayer.IsRepeating = true;
        }