private void tykacz_Tick_1(object sender, EventArgs e)
 {
     toolStripProgressBar1.Value = gameView.Width * 10 - leafs[1].X;
     if (isFrogEating())
     {
         eaten++;
         guzikPożywienie.Text = eaten.ToString();
     }
     ;
     if (frogJump > 0)
     {
         frogLocation.Y -= 9;
         frogJump       -= 10;
     }
     else
     {
         if (!isFrogOnLeaf())
         {
             frogLocation.Y += 13;
         }
     }
     for (int i = 0; i < leafs.Length; i++)
     {
         leafs[i].X -= 14;
     }
     for (int i = 0; i < foods.Length; i++)
     {
         foods[i].X -= 14;
     }
     for (int i = 0; i < birds.Length; i++)
     {
         birds[i].X -= 14;
     }
     if (isBirdEatingFrog() || frogLocation.Y > gameView.Height || leafs[1].X < 0)
     {
         gameOver = true;
         wstzrymajToolStripMenuItem_Click(null, null);
         if (Program.loggedUser != "" && isDatabase)
         {
             gameResult gr = new gameResult()
             {
                 name = Program.loggedUser, points = eaten
             };
             Program.database.gameResult.InsertOnSubmit(gr);
             Program.database.SubmitChanges();
         }
         else if (isDatabase)
         {
             gameResult gr = new gameResult()
             {
                 name = "niewiadomy", points = eaten
             };
             Program.database.gameResult.InsertOnSubmit(gr);
             Program.database.SubmitChanges();
         }
     }
     DrawAllObjects();
 }
Beispiel #2
0
 partial void UpdategameResult(gameResult instance);
Beispiel #3
0
 partial void DeletegameResult(gameResult instance);
Beispiel #4
0
 partial void InsertgameResult(gameResult instance);