Example #1
0
        public Sanitizerball(TileMap level, Vector2 initPos, Vector2 initVel) : base(level, initPos, initVel, level.GetGravity())
        {
            TextureType            = typeof(Sanitizerball);
            CollisionBox.ColorType = typeof(Sanitizerball);

            Sprite  = new SanitizerballSprite(2, 5, 2, 1, true, this);
            CanClip = false;
        }
Example #2
0
 public override void Update(GameTime gameTime)
 {
     if ((Position.X >= Level.Avatar.Position.X + (Game1.ScreenWidth / 2) + 50 && Position.X >= Game1.ScreenWidth) || (Position.X <= Level.Avatar.Position.X - (Game1.ScreenWidth / 2) - 50 && Position.X <= Level.MapWidth - Game1.ScreenWidth))
     {
         ToBeRemoved = true;
     }
     if (isExploded)
     {
         Sprite = new SanitizerballSprite(2, 5, 3, 7, true, this);
         if (timeExploded.TotalMilliseconds == 0)
         {
             timeExploded = gameTime.TotalGameTime;
         }
         else if (gameTime.TotalGameTime > timeExploded + new TimeSpan(0, 0, 0, 0, 500))
         {
             ToBeRemoved = true;
         }
     }
     else
     {
         base.Update(gameTime);
     }
 }