// fonction appellée par le choronomètre toutes les xxx ms void GameLoop(Object myObject, EventArgs myEventArgs) { // boucle sur l'IA MainLoop.DoIt(Timer.GetDeltaTime() / 1000.0); Draw(); Global.Round++; pictureBox1.Invalidate(); pictureBox1.Update(); // demande l'affichage }
// fonction appellée par le choronomètre toutes les xxx ms void GameLoop(Object myObject, EventArgs myEventArgs) { if (Global.stateofthegame != Global.GameState.Loose) { // boucle sur l'IA Global.DeltaTime = Timer.GetDeltaTime() / 1000; MainLoop.DoIt(); Draw(); Global.Round++; pictureBox1.Invalidate(); pictureBox1.Update(); // demande l'affichage } else { Global.Sprites.Get("zombiesWon").DrawToScreen(300, 500); pictureBox1.Invalidate(); pictureBox1.Update(); // demande l'affichage } }