本文整理汇总了C#中Area.SetPlayerStartLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Area.SetPlayerStartLocation方法的具体用法?C# Area.SetPlayerStartLocation怎么用?C# Area.SetPlayerStartLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area.SetPlayerStartLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUpdateFrame
public void OnUpdateFrame(FrameEventArgs e, KeyboardDevice Keyboard, MouseDevice Mouse)
{
if (!fadingOut && fadeBox.Color.A > 0)
{
fadeBox.Color = new Color4(0, 0, 0, fadeBox.Color.A - (float)e.Time * fadeTime);
}
if (fadingOut)
{
if (fadeBox.Color.A < 1)
fadeBox.Color = new Color4(0, 0, 0, fadeBox.Color.A + (float)e.Time * fadeTime);
else
{
if (gameWon)
{
MainWindow.state = new EndMenuState();
Resources.StopAllAudio();
//Resources.UnloadAudioBuffers();
}
else
{
Type oldAreaType = area.GetType();
area.Unload();
area = tempNewArea;
area.LoadContent(data);
player.MoveTo(area.SetPlayerStartLocation(oldAreaType));
GL.ClearColor(area.ClearColor);
fadingOut = false;
}
}
}
player.Moving = false;
if (Keyboard[Key.Up])
{
player.MoveBy(new Vector2(0, (float)(e.Time * Player.MoveSpeed)));
player.Moving = true;
}
if (Keyboard[Key.Down])
{
player.MoveBy(new Vector2(0, -(float)(e.Time * Player.MoveSpeed)));
player.Moving = true;
}
if (Keyboard[Key.Left])
{
player.MoveBy(new Vector2(-(float)(e.Time * Player.MoveSpeed), 0));
player.Moving = true;
}
if (Keyboard[Key.Right])
{
player.MoveBy(new Vector2((float)(e.Time * Player.MoveSpeed), 0));
player.Moving = true;
}
c.Update(e.Time);
player.Update(e.Time);
message = string.Empty;
foreach (TriggerChangeArea trigger in area.AreaChangeTriggers)
{
if (PhysicsManager.IsColliding(player.BoundingBox, trigger.BBox))
{
tempNewArea = trigger.Area;
fadingOut = true;
break;
}
}
foreach (TriggerButtonPress trigger in area.ButtonPressTriggers)
{
if (PhysicsManager.IsColliding(player.BoundingBox, trigger.BBox))
{
trigger.Button.Activated = true;
}
else
{
if (trigger.Button.Activated)
{
trigger.Activate();
}
}
}
foreach (TriggerEndgame trigger in area.EndgameTrigger)
{
if (PhysicsManager.IsColliding(player.BoundingBox, trigger.BBox))
{
if (Keyboard[Key.Z])
{
fadingOut = true;
gameWon = true;
}
else
//.........这里部分代码省略.........