コード例 #1
0
ファイル: Game1.cs プロジェクト: jakiboy98/Shooter
        private void AddProjectile(Vector2 position)
        {
            Projectile projectile = new Projectile();

            projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position);
            projectiles.Add(projectile);
        }
コード例 #2
0
        private void AddProjectile(Vector2 position)
        {
            Projectile pro = new Projectile();

            pro.Initialize(projectileTexture, position);
            projectiles.Add(pro);
            laserSound.Play();
        }
コード例 #3
0
        private void AddProjectile(Vector2 position)
        {
            // Play the laser sound
            laserSound.Play();

            Projectile projectile = new Projectile();

            projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position);
            projectiles.Add(projectile);
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: basse747/OwnCreatedPrograms
 private void AddProjectile(Vector2 position)
 {
     Projectile projectile = new Projectile();
     projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position);
     projectiles.Add(projectile);
 }
コード例 #5
0
ファイル: Game1.cs プロジェクト: Achanigo/Multiplayer_Shooter
 private void UpdatePorParser(string parsa)
 {
     if (!string.IsNullOrEmpty(parsa))
     {
         string[] arr = parsa.Split('@');
         string p1 = arr[0];
         string p2 = arr[1];
         if (!string.IsNullOrEmpty(p1))
         {
             arr = p1.Split('*');
             string balas1 = arr[0];
             string dp1 = arr[1];
             arr = dp1.Split('%');
             player.Health = Convert.ToInt32(arr[1]);
             string[] pos = arr[0].Split(',');
             player.Position.X = Convert.ToInt32(pos[0]);
             player.Position.Y = Convert.ToInt32(pos[1]);
             arr = balas1.Split('|');
             List<Projectile> lista = new List<Projectile>();
             for(int i = 0;i<arr.Length;i++){
                 string []tmp = arr[i].Split(',');
                 Projectile projectile = new Projectile();
                 projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, new Vector2(Convert.ToInt32(arr[0]), Convert.ToInt32(arr[1])), 1);
                 lista.Add(projectile);
             }
             projectiles = lista;
         }
         if (!string.IsNullOrEmpty(p2))
         {
             arr = p2.Split('*');
             string balas2 = arr[0];
             string dp2 = arr[1];
             arr = dp2.Split('%');
             player2.Health = Convert.ToInt32(arr[1]);
             string[] pos = arr[0].Split(',');
             player2.Position.X = Convert.ToInt32(pos[0]);
             player2.Position.Y = Convert.ToInt32(pos[1]);
             arr = balas2.Split('|');
             List<Projectile> lista = new List<Projectile>();
             for (int i = 0; i < arr.Length; i++)
             {
                 string[] tmp = arr[i].Split(',');
                 Projectile projectile = new Projectile();
                 projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, new Vector2(Convert.ToInt32(arr[0]), Convert.ToInt32(arr[1])), 1);
                 lista.Add(projectile);
             }
             projectiles2 = lista;
         }
     }
 }
コード例 #6
0
ファイル: Game1.cs プロジェクト: MattyRad/SpaceWar
 private void AddProjectile(Vector2 position)
 {
     Projectile projectile = new Projectile();
     projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position);
     projectile.xmove = currentGamePadState.ThumbSticks.Right.X * 10.0f;
     projectile.ymove = currentGamePadState.ThumbSticks.Right.Y * 10.0f;
     projectiles.Add(projectile);
 }
コード例 #7
0
ファイル: Game1.cs プロジェクト: remy22/shooterGame
        private void AddProjectile(Vector2 position)
        {
            Projectile projectile = new Projectile();
            projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position);
            projectiles.Add(projectile);

            /*
            if(levelUp == true)
            {
                projectile.Damage = projectile.Damage + 20;
                projectile.projectileMoveSpeed = projectile.projectileMoveSpeed + 2;
            }
             */
        }
コード例 #8
0
ファイル: Game1.cs プロジェクト: merovigiam/estudo_xna
        private void AddProjectile(Vector2 position)
        {
            Projectile projectile;
            switch (nivelTiro)
            {
                case 0:
                case 1:
                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,35));
                    projectiles.Add(projectile);
                    break;

                case 2:
                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,0));
                    projectiles.Add(projectile);

                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,70));
                    projectiles.Add(projectile);

                    break;

                case 3:
                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,0));
                    projectiles.Add(projectile);

                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,35));
                    projectiles.Add(projectile);

                    projectile = new Projectile();
                    projectile.Initialize(GraphicsDevice.Viewport, projectileTexture, position + new Vector2(100,70));
                    projectiles.Add(projectile);

                    break;
            }
        }
コード例 #9
0
ファイル: Game1.cs プロジェクト: snarkworks/game_experiments
 private void AddProjectile(Vector2 position)
 {
     Projectile pro = new Projectile();
     pro.Initialize(projectileTexture, position);
     projectiles.Add(pro);
     laserSound.Play();
 }