示例#1
0
 /// <summary>
 /// Player constructor loads all textures and initializes all static members
 /// </summary>
 /// <param name="game"></param>
 public Player(Game1 game)
 {
     position    = new Vector2(Game1.ScreenX / 2, Game1.ScreenY / 2);
     velocity    = Vector2.Zero;
     tex         = game.Content.Load <Texture2D>("PlayerTex/player");
     finalTex    = game.Content.Load <Texture2D>("PlayerTex/finalPlayer");
     bTex        = game.Content.Load <Texture2D>("PlayerTex/bullet");
     bTex2       = game.Content.Load <Texture2D>("PlayerTex/bullet2");
     bTex3       = game.Content.Load <Texture2D>("PlayerTex/bullet3");
     finalBTex   = game.Content.Load <Texture2D>("PlayerTex/finalBullet");
     wForm       = game.Content.Load <Texture2D>("PlayerTex/wormForm");
     finalWForm  = game.Content.Load <Texture2D>("PlayerTex/finalWormForm");
     bTex4       = game.Content.Load <Texture2D>("PlayerTex/bullet4");
     bullets     = new List <Bullet>();
     growers     = new List <Bullet>();
     blasts      = new List <BlastWave>();
     origin      = new Vector2(tex.Width / 2, tex.Height / 2);
     scale       = 1;
     Points      = 0;
     rotation    = 0;
     growthTimer = 0;
     stats       = LevelManager.Current.PlayerStats;
     CheckCreateWorm();
     sBombTimer = MIN_SBOMB_TIMER;
 }
示例#2
0
        //All public static interactions with the player
        #region Static Interaction

        /// <summary>
        /// Updates the player statistics to the current level state
        /// </summary>
        public static void NextLevel()
        {
            stats = LevelManager.Current.PlayerStats;
            CheckCreateWorm();
            if (stats.WormForm && stats.ColorChange)
            {
                WormForm.UpdateChainTexture(finalWForm);
            }
        }