示例#1
0
        public FroggerGame()
        {
            rand1 = new Random();

            score = new score();

            drawables = new List <IDrawable>();

            frogger = new Frogger();
            drawables.Add(frogger);
            rand2 = new Random();
            Text  = new TextBlock();


            viewCars();
            viewWater();


            drawables.Add(car_row_10);
            drawables.Add(car_row_9);
            drawables.Add(car_row_8);
            drawables.Add(car_row_7);

            drawables.Add(Turtles_1);
            drawables.Add(Logs_1);
            drawables.Add(Turtles_2);
            drawables.Add(Logs_2);

            Color color = Color.FromArgb(255, 0, 255, 0);

            Wall_1 = new BoundaryCollision(-128, 64, 704, color);
            Wall_2 = new BoundaryCollision(512, 64, 704, color);
            drawables.Add(Wall_1);
            drawables.Add(Wall_2);
        }
示例#2
0
        public void LowerScore(Frogger frogger)
        {
            switch (frogger.froggerRow - 1)
            {
            case 1:
                Score -= 100;
                break;

            case 2:
                Score -= 10;
                break;

            case 3:
                Score -= 10;
                break;

            case 4:
                Score -= 10;
                break;

            case 5:
                Score -= 10;
                break;

            case 6:
                Score -= 50;
                break;

            case 7:
                Score -= 10;
                break;

            case 8:
                Score -= 10;
                break;

            case 9:
                Score -= 10;
                break;

            case 10:
                Score -= 10;
                break;

            default:
                break;
            }
        }
示例#3
0
        public void SetScore(Frogger frogger)
        {
            switch (frogger.froggerRow)
            {
            case 1:
                Score += 100;
                break;

            case 2:
                Score += 10;
                break;

            case 3:
                Score += 10;
                break;

            case 4:
                Score += 10;
                break;

            case 5:
                Score += 10;
                break;

            case 6:
                Score += 50;
                break;

            case 7:
                Score += 10;
                break;

            case 8:
                Score += 10;
                break;

            case 9:
                Score += 10;
                break;

            case 10:
                Score += 10;
                break;

            default:
                break;
            }
        }
示例#4
0
 static void Main()
 {
     using (var game = new Frogger())
         game.Run();
 }