Exemplo n.º 1
0
 private void TryAttack(Player player)
 {
     AttackTimer.Tick();
     if (AttackTimer.IsReady)
     {
         player.TakeDamage(Damage);
         AttackTimer.Restart();
     }
 }
Exemplo n.º 2
0
 public static void TryAddCast(Map map, Dictionary <Point, Cast> casts)
 {
     SpawnCastTimer.Tick();
     if (SpawnCastTimer.IsReady)
     {
         var rnd      = new Random();
         var cast     = Casts[rnd.Next(0, Casts.Count)];
         var position = map.FindFreePlace(map.CellSize / 3);
         if (!casts.ContainsKey(position))
         {
             casts.Add(position, cast);
         }
         SpawnCastTimer.Interval *= 2;
         SpawnCastTimer.Restart();
     }
 }