Exemplo n.º 1
0
        public Game(string naam1, string naam2, Controls controls1, Controls controls2)
        {
            Controls1 = controls1;
            Controls2 = controls2;
            Naam1     = naam1;
            Naam2     = naam2;
            InitializeComponent();
            Paint += new PaintEventHandler(MijnPaint);

            // start beweging timer
            System.Windows.Forms.Timer bewegingTimer = new System.Windows.Forms.Timer
            {
                Interval = 1  // milisec
            };
            bewegingTimer.Tick += new System.EventHandler(BewegingTimerTick);
            bewegingTimer.Start();

            //start fps timer
            System.Windows.Forms.Timer refreshScreenTimer = new System.Windows.Forms.Timer
            {
                Interval = 1000 / FPS  // milisec
            };
            refreshScreenTimer.Tick += new System.EventHandler(refreshScreenTimerTick);
            refreshScreenTimer.Start();


            DoubleBuffered = true;
            int mandGrote = 100;

            mand1 = new Mand(300, ClientRectangle.Height - mandGrote, 0, 0, Naam1, 0, mandGrote, (float)0.4, (float)0.9, 10, 30, 5, @"../../files/images/manden/mand1.png");
            mand2 = new Mand(800, ClientRectangle.Height - mandGrote, 0, 0, Naam2, 0, mandGrote, (float)0.4, (float)0.9, 10, 30, 5, @"../../files/images/manden/mand2.png");

            explosions = new string[16];
            for (int i = 0; i < 16; i++)
            {
                explosions[i] = @"../../files/images/ballen/explosion/" + Convert.ToString(i + 1) + ".gif";
            }
            bom = new Bom(300, 10, 5, 0, 40, (float)0.40, (float)0.60, -10, @"../../files/sounds/grote_rekkerbalbots.wav", @"../../files/images/ballen/bom.png", explosions);
        }
Exemplo n.º 2
0
 public static bool IsInBalLijst(Bom bom)
 {
     return(ballen.Contains(bom));
 }
Exemplo n.º 3
0
 public static void VerwijderBom(Bom bom)
 {
     ballen.Remove(bom);
 }
Exemplo n.º 4
0
 public static bool IsBomInLijst(Bom bom)
 {
     return(bomLijst.Contains(bom));
 }