示例#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);
            bola        = new Bola(Content);
            jugador     = new Paleta(Content);
            mandar      = new Thread(new ThreadStart(mandacion));
            mandar.Start();

            // TODO: use this.Content to load your game content here
        }
示例#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);
     bola = new Bola(Content);
     jugador = new Paleta(Content);
     mandar = new Thread(new ThreadStart(mandacion));
     mandar.Start();
     
     // TODO: use this.Content to load your game content here
 }
示例#3
0
        public void update(int posi, Bola bola)
        {
            rect.X = (int)posicion.X;
            rect.Y = (int)posicion.Y-(rect.Height/2);
            posicion= new Vector2(100,512 + (posi-50)*-10);
            
            if (bola.posicion.X<0){
                soundEffectLose.Play();
            }


            if (colisiono > 0)
            {
                colisiono -= 1;
            }
            if (rect.Intersects(bola.rect))
            {
                colisiono = 10;
                soundEffectHit.Play();
            }

        }
示例#4
0
        public void update(int posi, Bola bola)
        {
            rect.X   = (int)posicion.X;
            rect.Y   = (int)posicion.Y - (rect.Height / 2);
            posicion = new Vector2(100, 512 + (posi - 50) * -10);

            if (bola.posicion.X < 0)
            {
                soundEffectLose.Play();
            }


            if (colisiono > 0)
            {
                colisiono -= 1;
            }
            if (rect.Intersects(bola.rect))
            {
                colisiono = 10;
                soundEffectHit.Play();
            }
        }
示例#5
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);

            bola    = new Bola(Content);
            jugador = new Paleta(Content);
            mandar  = new Thread(new ThreadStart(mandacion));
            mandar.Start();
            serialport = new SerialPort();
            font       = Content.Load <SpriteFont>("Fonts\\Fuente");
            String portname = "";

            foreach (string name in SerialPort.GetPortNames())
            {
                portname = name;
            }
            serialport.PortName = portname;
            serialport.BaudRate = 9600;
            serialport.Parity   = Parity.None;
            serialport.DataBits = 8;
            serialport.Open();
            serialport.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPortRecibir);

            ConvSerial = new Thread(new ThreadStart(parseSerialData));
            ConvSerial.Start();
            musica = Content.Load <Song>("Sounds\\HyperspaceBonusLeft");


            recibioPlay = false;
            background  = Content.Load <Texture2D>("Sprites\\bgLeft");
            cursor      = new Cursor[101];
            for (int i = 1; i <= 100; i++)
            {
                cursor[i] = new Cursor(Content);
            }
            // TODO: use this.Content to load your game content here
        }
示例#6
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);

            bola = new Bola(Content);
            jugador = new Paleta(Content);
            mandar = new Thread(new ThreadStart(mandacion));
            mandar.Start();
            serialport = new SerialPort();
            font = Content.Load<SpriteFont>("Fonts\\Fuente");
            String portname = "";
           
            foreach (string name in SerialPort.GetPortNames())
            {
                portname = name;                
            }
            serialport.PortName = portname;
            serialport.BaudRate = 9600;
            serialport.Parity = Parity.None;
            serialport.DataBits = 8;
            serialport.Open();
            serialport.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPortRecibir);

            ConvSerial = new Thread(new ThreadStart(parseSerialData));
            ConvSerial.Start();
            musica = Content.Load<Song>("Sounds\\HyperspaceBonusLeft");

            
            recibioPlay = false;
            background = Content.Load<Texture2D>("Sprites\\bgLeft");
            cursor = new Cursor[101];
            for (int i = 1; i <= 100; i++)
            {
                cursor[i] = new Cursor(Content);
            }
            // TODO: use this.Content to load your game content here
        }