Esempio n. 1
0
        public void Initialize(Texture2D imagenEnemigo, Vector2 posicionEnemigo)
        {
            this.imagenEnemigo = imagenEnemigo;
            this.posicionEnemigo = posicionEnemigo;
            rectEnemigo = new Rectangle((int)posicionEnemigo.X,(int)posicionEnemigo.Y, 50, 50);
            activo = true;

            animacionEnemigo = new Animacion();
            animacionEnemigo.Initialize(this.imagenEnemigo, this.posicionEnemigo,8, 47,61,40,1);
        }
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
            fondo = Content.Load<Texture2D>("fondo");

            playerAnimacion = new Animacion();
            playerAnimacion.Initialize(Content.Load<Texture2D>("player"), new Vector2(100, 125), 8, 115, 69, 40, 1);

            musicaFondo = Content.Load<Song>("menuMusic");
            MediaPlayer.Play(musicaFondo);
            MediaPlayer.IsRepeating = true;

            musicaExplosion = Content.Load<SoundEffect>("explosion");

            paleta = Content.Load<Texture2D>("lpaddle");
            posicionPaleta = new Vector2(100,125);
            rectPaleta = new Rectangle((int)posicionPaleta.X, (int)posicionPaleta.Y, GraphicsDevice.Viewport.Width / 20, GraphicsDevice.Viewport.Height / 5);

            TouchPanel.EnabledGestures = GestureType.FreeDrag;
        }