public void UpdateLupoCattivo() { if (lc != null && (lc.Coord.X > GraphicsDevice.DisplayMode.Width || lc.Coord.Y > GraphicsDevice.DisplayMode.Height)) { lc = null; attentiAlLupo = false; } else { lc.UpdateLupo(); } }
public void TouchInput() { MouseState tc = Mouse.GetState(); if (!Menu.IsMenuShown) { if (!attentiAlLupo) { if (!ilVecchioContiene(tc)) { if (vite >= 0) { NuvolaGen toRemovePecora = IntersectPecorelle(tc); if (toRemovePecora != null) { int quale = listaPecorelle.IndexOf(toRemovePecora); listaPecorelle[quale].Touched = true; punti += 10; } else { NuvolaGen toRemoveNuvola = IntersectNuvolette(tc); if (toRemoveNuvola != null) { int quale = listaNuvole.IndexOf(toRemoveNuvola); listaNuvole[quale].Touched = true; if (vite >= 0) { vite--; if (vite >= 0) { for (int i = 0; i < listaPecorelle.Count; i++) { listaPecorelle[i].ScappaDalLupoCattivo(rand.Next(5, 11)); } lc = new LupoCattivo(); attentiAlLupo = true; } } } } } else { Menu.IsMenuShown = true; vite = 0; } } } } else { if (Menu.MenuTouchInput(tc) == 1 && !ilVecchioContiene(tc)) { InizializzaGioco(); Menu.IsMenuShown = false; } if (Menu.MenuTouchInput(tc) == 2 && !ilVecchioContiene(tc)) { isSubmitting = true; new Form1(this).ShowDialog(); } } _oldPanel = Mouse.GetState(); }