当前位置: 首页>>代码示例>>C#>>正文


C# World.addPlanet方法代码示例

本文整理汇总了C#中World.addPlanet方法的典型用法代码示例。如果您正苦于以下问题:C# World.addPlanet方法的具体用法?C# World.addPlanet怎么用?C# World.addPlanet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.addPlanet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Game

        public Game(GamePlay page)
        {
            random = new Random();
            score = 0;
            int minradius=70;
            int maxradius=150;
            this.page = page;
            w = new World(page, this);
            w.setSpaceship(new Spaceship());
            <<<<<<< HEAD
            int ei = random.Next(0, 6);
            for (int i = 0; i < 7; i++)
            =======
            <<<<<<< HEAD
            int ei = random.Next(0, 8);
            for (int i = 0; i < 9; i++)
            >>>>>>> 7395723aea8da5fff561b8e20616c6f37c826d7a
                if (ei != i) w.addPlanet(new Planet(random,minradius,maxradius, i));
                else w.addPlanet(new Planet(random,2*minradius,maxradius,i, true));
            =======

            for (int i = 0; i < 10; i++) w.addPlanet(new Planet(random,minradius,maxradius, i));
            w.addPlanet(new Planet(random,2*minradius,maxradius,random.Next(0, 9), true));
            >>>>>>> f629e5c28095f54b24d8872f88c38663475e65dc
        }
开发者ID:jdaerthe,项目名称:Planets,代码行数:25,代码来源:Game.cs

示例2: Game

 public Game(GamePlay page)
 {
     random = new Random();
     score = 0;
     int minradius=70;
     int maxradius=150;
     this.page = page;
     w = new World(page, this);
     w.setSpaceship(new Spaceship());
     int ei = random.Next(0, 6);
     for (int i = 0; i < 7; i++)
         if (ei != i) w.addPlanet(new Planet(random,minradius,maxradius, i));
         else w.addPlanet(new Planet(random,2*minradius,maxradius,i, true));
 }
开发者ID:eaortiz,项目名称:Planets,代码行数:14,代码来源:Game.cs

示例3: step

        public void step(object s, object ev)
        {
            switch (w.step())
            {
                case 0:
                    Graphics.update(page, w);
                    break;
                case 1:
                    timer.Stop();
                   /* Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
                    if (localSettings.Values["highscore"] == null) localSettings.Values["highscore"] = 0;
                    if ((int)localSettings.Values["highscore"] < score)
                    {
                        localSettings.Values["highscore"] = score;
                        page.HighScore1.IsOpen = true;
                    }*/
                    break;
                case 2:
                    timer.Stop();
                    score++;
                    for (int i = 0; i < page.ContentPanel1.Children.Count(); i++)
                    {
                        if (!(page.ContentPanel1.Children[i] is Popup) && !(page.ContentPanel1.Children[i] is TextBlock))
                        {
                            page.ContentPanel1.Children.RemoveAt(i--);
                        }
                    }
                    w = new World(page, this);
                    page.Score1.Text = "Score: " + score;
                    w.setSpaceship(new Spaceship());
                    int ei = random.Next(0, 6);
                    for (int i = 0; i < 7; i++)
                        if (ei != i) w.addPlanet(new Planet(random,70,150, i));
                        else w.addPlanet(new Planet(random,2*70,150,i, true));
                    Graphics.drawWorld(page, w);

                    break;

            }
        }
开发者ID:eaortiz,项目名称:Planets,代码行数:40,代码来源:Game.cs


注:本文中的World.addPlanet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。