Example #1
0
 // Determines how fast the PowerUp
 public void Initialize(PowerUpAnimation animation, Vector2 position, GameTime gameTime)
 {
     /// <summary>
     /// Places the object and  determines what type it is
     /// Uses Name as Type
     /// </summary>
     PowerUpAnimation = animation;
     Position = position;
     DetermineType();
     SpawnTime = gameTime.TotalGameTime;
     TotalTime = TimeSpan.FromSeconds(7.0f);
 }
Example #2
0
 private void AddPowerUp(GameTime gameTime)
 {
     PowerUpAnimation powerUpAnimation = new PowerUpAnimation();
     powerUpAnimation.Initialize(powerUpTexture, 0, 50, 50);
     Vector2 position = new Vector2(random.Next(100, GraphicsDevice.Viewport.Width - 50), random.Next(100, GraphicsDevice.Viewport.Height - 50));
     PowerUp powerup = new PowerUp();
     powerup.Initialize(powerUpAnimation, position, gameTime);
     powerups.Add(powerup);
 }