Esempio n. 1
0
        /// <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);

            // TODO: use this.Content to load your game content here

            // Load our game sprites, and set up rectangles for each
            texCat     = Content.Load <Texture2D>("cat");
            texFurball = Content.Load <Texture2D>("furball");
            texAlien   = Content.Load <Texture2D>("alien");
            texAcid    = Content.Load <Texture2D>("acid");

            var rectCat     = new Rectangle(50, 300, texCat.Width, texCat.Height);
            var rectFurball = new Rectangle(2000, 0, texFurball.Width, texFurball.Height);
            var rectAlien   = new Rectangle(1000, 500, texAlien.Width, texAlien.Height);
            var rectAcid    = new Rectangle(-2000, 0, texAcid.Width, texAcid.Height);

            var controlPad = new ControlPad(PlayerIndex.One);

            _GameWorld = new GameWorld(controlPad, rectCat, texCat, rectFurball, texFurball, rectAlien, texAlien, rectAcid, texAcid);
            _GameWorld.ActivateAlien();
        }
Esempio n. 2
0
        /// <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);

            // TODO: use this.Content to load your game content here

            // Load our game sprites, and set up rectangles for each
            texCat      = Content.Load<Texture2D>("cat");
            texFurball  = Content.Load<Texture2D>("furball");
            texAlien    = Content.Load<Texture2D>("alien");
            texAcid     = Content.Load<Texture2D>("acid");

            var rectCat     = new Rectangle(50, 300, texCat.Width, texCat.Height);
            var rectFurball = new Rectangle(2000, 0, texFurball.Width, texFurball.Height);
            var rectAlien   = new Rectangle(1000, 500, texAlien.Width, texAlien.Height);
            var rectAcid    = new Rectangle(-2000, 0, texAcid.Width, texAcid.Height);

            var controlPad = new ControlPad(PlayerIndex.One);

            _GameWorld = new GameWorld(controlPad, rectCat, texCat, rectFurball, texFurball, rectAlien, texAlien, rectAcid, texAcid);
            _GameWorld.ActivateAlien();
        }