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