//Function to paint on the FORM (repaint also) private void Form1_Paint(object sender, PaintEventArgs e) { // Clear the screen e.Graphics.Clear(Color.White); // Set the Background BG.Draw(e.Graphics); // Set the upper Background BG1.Draw(e.Graphics); //Draw clouds foreach (cloud t in clouds) { t.Draw(e.Graphics); } //Draw the player Rockets for (int i = 0; i < playerPlane.getFiredRocekts().Count; i++) { playerPlane.getFiredRocekts()[i].Draw(e.Graphics); } //Draw Bullets for (int i = 0; i < playerPlane.getFiredBullets().Count; i++) { playerPlane.getFiredBullets()[i].Draw(e.Graphics); } //Check if the Boss Fight is taking place if (!BosFight) { //Draw enemy plain at last possition for (int i = 0; i < Planes.Count; i++) { Planes[i].Draw(e.Graphics); } //Draw "Bam picture" if a enemy plane has been destroyed if (Blast) { Blast = false; e.Graphics.DrawImage(Images.getWinImg(), xBam, yBam); } } //Draw the Boss and his Rockets else { boss.Draw(e.Graphics); foreach (Rocket r in bossRockets) { r.Draw(e.Graphics); } } //Check if the player is dead to draw the last image if (playerPlane.getPlayerLife() == 0) { e.Graphics.DrawImage(Images.getLoseImg(), playerPlane.getX(), playerPlane.getY()); } // Draw the player plane else { playerPlane.Draw(e.Graphics); } }