Exemplo n.º 1
0
        //下压完成。判断小人方位。这个是最后一步sb1.Begin();
        private async void sb2_Completed(object sender, object e)
        {
            //2014年6月7号下午到这里停止。。。。。。。。随后再写这下面的代码;;;;;;;;;;;;;;;;;;;
            //先判断小人有没过关吧???
            Block block = new Block();

            foreach (Block item in smallMans)
            {
                if (item.IsVisSmallMan == true)
                {
                    block = item;
                }
            }
            if (block.X == visBlocks[0].X)
            {
                //把前一关没有上去的格子取到。。。上去的是
                foreach (Block item in BlockUplists)
                {
                    FuBlockUplists = allBlocks;
                    FuBlockUplists.Remove(item);
                }
                //没有上去的格子从0下到1500
                foreach (Block item in FuBlockUplists)
                {
                    //20140608上午。从下午继续。这里写0到1500下去方块。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
                    BlockRectangle b1 = allBlockRectangles.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0To1500();
                }

                foreach (Block item in BlockUplists)
                {
                    BlockRectangle b1 = allBlockRectangles.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0ToFu1500();
                }

                //把Uplists加回到allBlocks;
                foreach (Block item in BlockUplists)
                {
                    allBlocks.Add(item);
                }
                //SmallMan s1 = allSmallMans.First(smallman => smallman.Tag == block.Tag);
                //s1.StartUP();
                //Task.Delay(300);
                //s1.StartUpBack();

                sb1.Begin();
                From0To1500.Begin();
                //说明过关了。执行sb1.begin()开始下一关。在sb1完成后生成下一关的块。。。
            }
            else
            {
                GameOverScore.Text      = level.ToString() + "步";
                GameOverGrid.Visibility = Visibility.Visible;
                mediaElement.Play();
                //string mm = sw.Elapsed.Minutes.ToString();
                //string ss = sw.Elapsed.Seconds.ToString();
                //await new MessageDialog("您坚持了:" + mm + "分" + ss + "秒").ShowAsync();
                #region 1-33关的语句描述
                if (level <= 3)
                {
                    switch (level)
                    {
                    case 0:
                        GameOverText.Text = "我还能说什么";
                        break;

                    case 1:
                        GameOverText.Text = "一步一风云";
                        break;

                    case 2:
                        GameOverText.Text = "双脚落地";
                        break;

                    case 3:
                        GameOverText.Text = "宝宝你走三步了";
                        break;
                    }
                }
                else if (level < 8)
                {
                    GameOverText.Text = "徒儿快学会跑了";
                }
                else if (level < 12)
                {
                    GameOverText.Text = "诶哟~不错哟";
                }

                else if (level <= 33)
                {
                    switch (level)
                    {
                    case 12:
                        GameOverText.Text = "初出茅庐";
                        break;

                    case 13:
                        GameOverText.Text = "初学乍练";
                        break;

                    case 14:
                        GameOverText.Text = "初窥门径";
                        break;

                    case 15:
                        GameOverText.Text = "小试牛刀";
                        break;

                    case 16:
                        GameOverText.Text = "略有小成";
                        break;

                    case 17:
                        GameOverText.Text = "小有成就";
                        break;

                    case 18:
                        GameOverText.Text = "驾轻就熟";
                        break;

                    case 19:
                        GameOverText.Text = "移形换位";
                        break;

                    case 20:
                        GameOverText.Text = "融会贯通";
                        break;

                    case 21:
                        GameOverText.Text = "炉火纯青";
                        break;

                    case 22:
                        GameOverText.Text = "出类拔萃";
                        break;

                    case 23:
                        GameOverText.Text = "技冠群雄";
                        break;

                    case 24:
                        GameOverText.Text = "出神入化";
                        break;

                    case 25:
                        GameOverText.Text = "傲视群雄";
                        break;

                    case 26:
                        GameOverText.Text = "登峰造极";
                        break;

                    case 27:
                        GameOverText.Text = "惊世骇俗";
                        break;

                    case 28:
                        GameOverText.Text = "震古铄今";
                        break;

                    case 29:
                        GameOverText.Text = "威镇寰宇";
                        break;

                    case 30:
                        GameOverText.Text = "空前绝后";
                        break;

                    case 31:
                        GameOverText.Text = "天人合一";
                        break;

                    case 32:
                        GameOverText.Text = "返璞归真";
                        break;

                    case 33:
                        GameOverText.Text = "牛B的人物好牛B";
                        break;
                    }
                }
                else
                {
                    GameOverText.Text = "截图````要快!";
                }
                #endregion
                sw.Stop();
                sw.Reset();
                if (level > score)
                {
                    if (setting.Values.ContainsKey("score"))
                    {
                        setting.Values["score"] = level.ToString();
                    }
                    JiRu.Text = "你已破记录!你走了:" + level + "步";
                    score     = level;
                }
                lvThemeBackGround.Visibility = Visibility.Visible;//左右彩条死后再显示出来;
                lvTheme.Visibility           = Visibility.Visible;
            }
        }
Exemplo n.º 2
0
        //下压完成。判断小人方位。这个是最后一步sb1.Begin();
        private async void sb2_Completed(object sender, object e)
        {
            //2014年6月7号下午到这里停止。。。。。。。。随后再写这下面的代码;;;;;;;;;;;;;;;;;;;
            //先判断小人有没过关吧???
            Block block = new Block();

            foreach (Block item in smallMans)
            {
                if (item.IsVisSmallMan == true)
                {
                    block = item;
                }
            }
            //这里写地图2先判断小人有没有过关吧;
            Block block2 = new Block();

            foreach (Block item in smallMans2)
            {
                if (item.IsVisSmallMan == true)
                {
                    block2 = item;
                }
            }

            if (block.X == visBlocks[0].X && block2.X == visBlocks2[0].X)//这里写地图2添加了地图2也必须过关的判断;
            {
                //把前一关没有上去的格子取到。。以便sb1的时候送下去;
                foreach (Block item in BlockUplists)
                {
                    FuBlockUplists = allBlocks;
                    FuBlockUplists.Remove(item);
                }
                //没有上去的格子从0下到1500
                foreach (Block item in FuBlockUplists)
                {
                    BlockRectangle b1 = allBlockRectangles.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0To1500();
                }
                foreach (Block item in BlockUplists)
                {
                    BlockRectangle b1 = allBlockRectangles.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0ToFu1500();
                }

                //这里写地图2//把前一关没有上去的格子取到。。以便sb1的时候送下去;
                foreach (Block item in BlockUplists2)
                {
                    FuBlockUplists2 = allBlocks2;
                    FuBlockUplists2.Remove(item);
                }
                foreach (Block item in FuBlockUplists2)
                {
                    BlockRectangle b1 = allBlockRectangles2.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0To1500();
                }
                foreach (Block item in BlockUplists2)
                {
                    BlockRectangle b1 = allBlockRectangles2.First(retangle => retangle.Tag == item.Tag);
                    b1.Start0ToFu1500();
                }

                //把Uplists加回到allBlocks;
                foreach (Block item in BlockUplists)
                {
                    allBlocks.Add(item);
                }
                //这里写地图2把Uplists2加回到allBlocks2;
                foreach (Block item in BlockUplists2)
                {
                    allBlocks2.Add(item);
                }
                if (level > 100)
                {
                    await new MessageDialog("恭喜通关,您已练成凌波微步;").ShowAsync();
                    GameOverScore.Text      = level.ToString() + "步";
                    GameOverGrid.Visibility = Visibility.Visible;
                    if (level > score)
                    {
                        if (setting.Values.ContainsKey("score"))
                        {
                            setting.Values["score"] = level.ToString();
                        }
                        JiRu.Text = "你已破记录!你走了:" + level + "步";
                        score     = level;
                    }
                    lvThemeBackGround.Visibility  = Visibility.Visible;   //左右彩条死后再显示出来;
                    lvTheme.Visibility            = Visibility.Visible;
                    CenterRec.Visibility          = Visibility.Collapsed; //中线隐藏起来;
                    GridJianBianDonHua.Visibility = Visibility.Collapsed;
                    sbJianBianDonHua0.Stop();
                    sbJianBianDonHua1.Stop();
                    return;
                }
                sb1.Begin();
                From0To1500.Begin();
                //说明过关了。执行sb1.begin()开始下一关。在sb1完成后生成下一关的块。。。
            }
            else
            {
                GameOverScore.Text      = level.ToString() + "步";
                GameOverGrid.Visibility = Visibility.Visible;
                mediaElement.Play();
                //string mm = sw.Elapsed.Minutes.ToString();
                //string ss = sw.Elapsed.Seconds.ToString();
                //await new MessageDialog("您坚持了:" + mm + "分" + ss + "秒").ShowAsync();
                #region 1-33关的语句描述
                if (level <= 3)
                {
                    switch (level)
                    {
                    case 0:
                        GameOverText.Text = "我还能说什么";
                        break;

                    case 1:
                        GameOverText.Text = "一步一风云";
                        break;

                    case 2:
                        GameOverText.Text = "双脚落地";
                        break;

                    case 3:
                        GameOverText.Text = "宝宝你走三步了";
                        break;
                    }
                }
                else if (level <= 100)
                {
                    switch (level / 4)
                    {
                    case 1:
                        GameOverText.Text = "基础牢固";
                        break;

                    case 2:
                        GameOverText.Text = "徒儿快学会跑了";
                        break;

                    case 3:
                        GameOverText.Text = "初学乍练";
                        break;

                    case 4:
                        GameOverText.Text = "初窥门径";
                        break;

                    case 5:
                        GameOverText.Text = "初窥门径";
                        break;

                    case 6:
                        GameOverText.Text = "小试牛刀";
                        break;

                    case 7:
                        GameOverText.Text = "略有小成";
                        break;

                    case 8:
                        GameOverText.Text = "小有成就";
                        break;

                    case 9:
                        GameOverText.Text = "驾轻就熟";
                        break;

                    case 10:
                        GameOverText.Text = "移形换位";
                        break;

                    case 11:
                        GameOverText.Text = "融会贯通";
                        break;

                    case 12:
                        GameOverText.Text = "炉火纯青";
                        break;

                    case 13:
                        GameOverText.Text = "出类拔萃";
                        break;

                    case 14:
                        GameOverText.Text = "技冠群雄";
                        break;

                    case 15:
                        GameOverText.Text = "出神入化";
                        break;

                    case 16:
                        GameOverText.Text = "傲视群雄";
                        break;

                    case 17:
                        GameOverText.Text = "登峰造极";
                        break;

                    case 18:
                        GameOverText.Text = "惊世骇俗";
                        break;

                    case 19:
                        GameOverText.Text = "震古铄今";
                        break;

                    case 20:
                        GameOverText.Text = "威镇寰宇";
                        break;

                    case 21:
                        GameOverText.Text = "空前绝后";
                        break;

                    case 22:
                        GameOverText.Text = "天人合一";
                        break;

                    case 23:
                        GameOverText.Text = "返璞归真";
                        break;

                    case 24:
                        GameOverText.Text = "一步之差";
                        break;
                    }
                }
                else
                {
                    GameOverText.Text = "截图````要快!";
                }
                #endregion
                //sw.Stop();
                //sw.Reset();//秒表现在不用,用的时候再反注释一下;
                if (level > score)
                {
                    if (setting.Values.ContainsKey("score"))
                    {
                        setting.Values["score"] = level.ToString();
                    }
                    JiRu.Text = "你已破记录!你走了:" + level + "步";
                    score     = level;
                }
                lvThemeBackGround.Visibility  = Visibility.Visible;   //左右彩条死后再显示出来;
                lvTheme.Visibility            = Visibility.Visible;
                CenterRec.Visibility          = Visibility.Collapsed; //中线隐藏起来;
                GridJianBianDonHua.Visibility = Visibility.Collapsed;
                sbJianBianDonHua0.Stop();
                sbJianBianDonHua1.Stop();
            }
        }