예제 #1
0
        //
        protected void LoadObjects()
        {
            // Create a Tree instance
            Texture2D[] burnTreeSequence = {
                Content.Load<Texture2D>("burning/burn_0"),
                Content.Load<Texture2D>("burning/burn_1"),
                Content.Load<Texture2D>("burning/burn_2"),
                Content.Load<Texture2D>("burning/burn_3"),
                Content.Load<Texture2D>("burning/burn_4"),
                Content.Load<Texture2D>("burning/burn_5"),
                Content.Load<Texture2D>("burning/burn_6"),
                Content.Load<Texture2D>("burning/burn_7"),
                Content.Load<Texture2D>("burning/burn_8"),
                Content.Load<Texture2D>("burning/burn_9")
            };
            Texture2D[] multiplyTree = {
                Content.Load<Texture2D>("tree/squirrelplant/planttree_0"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_1"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_2"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_3"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_4"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_5"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_6"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_7"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_8"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_9"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_10"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_11"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_12"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_13"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_14"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_15"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_16"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_17"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_18"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_19"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_20"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_21"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_22"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_23"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_24"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_25"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_26"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_27"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_28"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_29"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_30"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_31"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_32"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_33"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_34"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_35"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_36"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_37"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_38"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_39"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_40"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_41"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_42"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_43"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_44"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_45"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_46"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_47"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_48"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_49"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_50"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_51"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_52"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_53"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_54"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_55"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_56"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_57"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_58"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_59"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_60"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_61"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_62"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_63"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_64"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_65"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_66"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_67")
            };
            motherTree = new Tree(Content.Load<Texture2D>("tree/tree"), new Vector2(0, 0), new Vector2(0, 0),
                burnTreeSequence, Content.Load<Texture2D>("tree/burntTree"), Content.Load<Texture2D>("tree/burntTree"), multiplyTree);

            person = new People(Content.Load<Texture2D>("people/person"), new Vector2(0,0), new Vector2(0,0), null, Content.Load<Texture2D>("people/humanBurn"), Content.Load<Texture2D>("people/electrocute/electrocute_7"));

            // Create a House instance
            Texture2D[] burnHouseSequence = {
                Content.Load<Texture2D>("house/houseFire"),
                Content.Load<Texture2D>("burning/burn_0"),
                Content.Load<Texture2D>("burning/burn_1"),
                Content.Load<Texture2D>("burning/burn_2"),
                Content.Load<Texture2D>("burning/burn_3"),
                Content.Load<Texture2D>("burning/burn_4"),
                Content.Load<Texture2D>("burning/burn_5"),
                Content.Load<Texture2D>("burning/burn_6"),
                Content.Load<Texture2D>("burning/burn_7"),
                Content.Load<Texture2D>("burning/burn_8"),
                Content.Load<Texture2D>("burning/burn_9")
            };
            motherHouse = new House(Content.Load<Texture2D>("house/house"), new Vector2(0, 0), new Vector2(0, 0),
                                burnHouseSequence, Content.Load<Texture2D>("house/houseBurnt"), Content.Load<Texture2D>("house/houseLit"));

            Texture2D[] spinTornadoSequence = {
                Content.Load<Texture2D>("Tornado/tor_00"),
                Content.Load<Texture2D>("Tornado/tor_01"),
                Content.Load<Texture2D>("Tornado/tor_02"),
                Content.Load<Texture2D>("Tornado/tor_03"),
                Content.Load<Texture2D>("Tornado/tor_04"),
                Content.Load<Texture2D>("Tornado/tor_05"),
                Content.Load<Texture2D>("Tornado/tor_06"),
                Content.Load<Texture2D>("Tornado/tor_07"),
                Content.Load<Texture2D>("Tornado/tor_08"),
                Content.Load<Texture2D>("Tornado/tor_09"),
                Content.Load<Texture2D>("Tornado/tor_10"),
                Content.Load<Texture2D>("Tornado/tor_11"),
                Content.Load<Texture2D>("Tornado/tor_12")};

            motherTornado = new Tornado(spinTornadoSequence, new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0));
            motherHalo = new Halo(Content.Load<Texture2D>("Protect/bubble"), new Vector2(0, 0), new Vector2(0, 0));

            makePerson = new MakePerson(Content.Load<Texture2D>("people/person"), this, new Vector2(0,0), new Vector2(0, 0));
            sproutTree = new SproutTree(Content.Load<Texture2D>("UI/treeicon"), this, new Vector2(0, 0), new Vector2(0, 0));

            powers.Add(makePerson);
            powers.Add(new Electric(Content.Load<Texture2D>("UI/electric"), this, new Vector2(0,0), new Vector2(0,0)));
            //extras and placeholders for now
            //powers.Add(sproutTree);
            //powers.Add(new Fire(Content.Load<Texture2D>("UI/fireicon"), this, new Vector2(0, 0), new Vector2(0, 0)));
            //powers.Add(new BuildHouse(Content.Load<Texture2D>("UI/home"), this, new Vector2(0, 0), new Vector2(0, 0)));
        }
예제 #2
0
파일: FWPGame.cs 프로젝트: xcmel/FWPGame
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            chiF = Content.Load<SpriteFont>("ChillerFont");

            dadGod = Content.Load<Texture2D>("gods/DaddyGod");
            broGod = Content.Load<Texture2D>("gods/BrotherGod");
            sisGod = Content.Load<Texture2D>("gods/SisterGod");

            dadFont = Content.Load<SpriteFont>("gods/DaddyFont");
            broFont = Content.Load<SpriteFont>("gods/BrotherFont");
            sisFont = Content.Load<SpriteFont>("gods/SisterFont");

            intro = new Introduction(this, Content.Load<Texture2D>("gods/DaddyGod"), new Vector2(0,0), new Vector2(0,0), dadFont);

            myGrass = new GrassSprite(Content.Load<Texture2D>("grass"),
                new Vector2(0, 0), new Vector2(0, 0));
            myWater = new WaterSprite(Content.Load<Texture2D>("water"),
                new Vector2(0, 0), new Vector2(0, 0));
            myRoad = new Road(Content.Load<Texture2D>("road"),
                new Vector2(0, 0), new Vector2(0, 0));
            //Kill the game with Escape
            GameAction closeGame = new GameAction(this, this.GetType().GetMethod("ExitGame"), new object[0]);
            InputManager.AddToKeyboardMap(Keys.Escape, closeGame);

            GrowGrass grassPower = new GrowGrass(Content.Load<Texture2D>("UI/sprouts"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(grassPower);
            Rain rainPower = new Rain(Content.Load<Texture2D>("UI/raindrop"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(rainPower);
            sproutTree = new SproutTree(Content.Load<Texture2D>("UI/treeicon"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(sproutTree);
            BuildRoad buildRoad = new BuildRoad(Content.Load<Texture2D>("UI/roadicon"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(buildRoad);
            Fire fire = new Fire(Content.Load<Texture2D>("UI/fireicon"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(fire);
            BuildHouse housePower = new BuildHouse(Content.Load<Texture2D>("UI/house_icon"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(housePower);

            //Protect protect = new Protect(Content.Load<Texture2D>("UI/protect"), this, new Vector2(0, 0), new Vector2(0, 0));

            Dictionary<string, Power> myPowers = new Dictionary<string, Power>();
            myPowers.Add("grass", grassPower);
            myPowers.Add("sprout", sproutTree);
            myPowers.Add("fire", fire);
            myPowers.Add("house", housePower);

            List<Power> availablePowers = new List<Power>();
            //availablePowers.Add(protect);

            cursor = new Cursor(Content.Load<Texture2D>("cursor"), new Vector2(0,0), this, powers);
            player = new Player(Content.Load<Texture2D>("UI/icon"), Content.Load<Texture2D>("UI/iconBG"), chiF, new Vector2(0, 0),
                new Vector2(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), tempMapSize,
                cursor, powers, availablePowers);

            map = new Map(Content.Load<Texture2D>("Maps/Mars/marsorbit"),
                new Vector2(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height),
                new Vector2(0, 0),
                player);
            worldScale = map.baseScale;

            // TODO: use this.Content to load your game content here
            LoadObjects();

            FontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2,
                graphics.GraphicsDevice.Viewport.Height / 2);

            myApocalypse = new Apocalypse(this, myPowers);
            //myApocalypse.BuildVillage();

            mainMusic = Content.Load<SoundEffect>("Sound/mainMusic");
            mainMusicInstance = mainMusic.CreateInstance();
            mainMusicInstance.IsLooped = true;
            mainMusicInstance.Play();
        }
예제 #3
0
        //
        protected void LoadObjects()
        {
            // Create a Tree instance
            Texture2D[] burnTreeSequence = {
                Content.Load<Texture2D>("burning/burn_0"),
                Content.Load<Texture2D>("burning/burn_1"),
                Content.Load<Texture2D>("burning/burn_2"),
                Content.Load<Texture2D>("burning/burn_3"),
                Content.Load<Texture2D>("burning/burn_4"),
                Content.Load<Texture2D>("burning/burn_5"),
                Content.Load<Texture2D>("burning/burn_6"),
                Content.Load<Texture2D>("burning/burn_7"),
                Content.Load<Texture2D>("burning/burn_8"),
                Content.Load<Texture2D>("burning/burn_9")
            };
            Texture2D[] multiplyTree = {
                Content.Load<Texture2D>("tree/squirrelplant/planttree_0"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_1"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_2"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_3"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_4"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_5"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_6"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_7"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_8"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_9"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_10"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_11"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_12"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_13"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_14"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_15"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_16"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_17"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_18"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_19"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_20"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_21"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_22"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_23"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_24"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_25"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_26"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_27"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_28"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_29"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_30"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_31"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_32"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_33"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_34"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_35"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_36"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_37"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_38"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_39"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_40"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_41"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_42"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_43"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_44"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_45"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_46"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_47"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_48"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_49"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_50"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_51"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_52"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_53"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_54"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_55"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_56"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_57"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_58"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_59"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_60"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_61"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_62"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_63"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_64"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_65"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_66"),
                Content.Load<Texture2D>("tree/squirrelplant/planttree_67")
            };
            motherTree = new Tree(Content.Load<Texture2D>("tree/tree"), new Vector2(0, 0), new Vector2(0, 0),
                burnTreeSequence, Content.Load<Texture2D>("tree/burntTree"), multiplyTree);

            // Create a House instance
            Texture2D[] burnHouseSequence = {
                Content.Load<Texture2D>("house/houseFire"),
                Content.Load<Texture2D>("burning/burn_0"),
                Content.Load<Texture2D>("burning/burn_1"),
                Content.Load<Texture2D>("burning/burn_2"),
                Content.Load<Texture2D>("burning/burn_3"),
                Content.Load<Texture2D>("burning/burn_4"),
                Content.Load<Texture2D>("burning/burn_5"),
                Content.Load<Texture2D>("burning/burn_6"),
                Content.Load<Texture2D>("burning/burn_7"),
                Content.Load<Texture2D>("burning/burn_8"),
                Content.Load<Texture2D>("burning/burn_9")
            };
            motherHouse = new House(Content.Load<Texture2D>("house/house"), new Vector2(0, 0), new Vector2(0, 0),
                burnHouseSequence, Content.Load<Texture2D>("house/houseBurnt"));

            sproutTree = new SproutTree(Content.Load<Texture2D>("UI/treeicon"), this, new Vector2(0, 0), new Vector2(0, 0));
            powers.Add(sproutTree);
            powers.Add(new Fire(Content.Load<Texture2D>("UI/fireicon"), this, new Vector2(0, 0), new Vector2(0, 0)));
            powers.Add(new BuildHouse(Content.Load<Texture2D>("UI/home"), this, new Vector2(0, 0), new Vector2(0, 0)));
        }