Beispiel #1
0
 public override void CheckRange(Player player, GameTime gameTime)
 {
     if (State == SnappingPlantState.Normal)
       {
     if (Math.Abs(player.DrawBox.Center.X - DrawBox.Center.X) < SNAPPING_RANGE)
     {
       State = SnappingPlantState.Attacking;
       LastSnap = Game1.CurrentTime;
     }
       }
 }
Beispiel #2
0
        public SnappingPlant(Vector2 position)
        {
            HostileType = (int)HostilesTypes.SnappingPlant;

              Position = position;

              DrawBox = new Rectangle(0, 0, 120, 146);
              HitboxSrc = new Rectangle(70, 80, 44, 60);

              State = SnappingPlantState.Normal;

              Textures = new Texture2D[]
              {
            Sprites.GetTexture("Temp/snappingPlant"),
            Sprites.GetTexture("Temp/snappingPlantAttack")
              };
        }
Beispiel #3
0
 void RestoreState()
 {
     State = SnappingPlantState.Normal;
 }