本文整理汇总了C#中GameInfo.PanCameraToObject方法的典型用法代码示例。如果您正苦于以下问题:C# GameInfo.PanCameraToObject方法的具体用法?C# GameInfo.PanCameraToObject怎么用?C# GameInfo.PanCameraToObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameInfo
的用法示例。
在下文中一共展示了GameInfo.PanCameraToObject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformLogic
public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo)
{
var currentPlayer = gameInfo.CurrentPlayer;
bool reversing = currentPlayer.CurrentNode == currentPlayer.NextNode;
var currentLocation = currentPlayer.Location;
var targetLocation =
reversing
? currentPlayer.NextNode.GetTravelPosition(gameInfo.CurrentPlayerIndex, gameInfo.TotalPlayers)
: currentPlayer.NextNode.Center;
float newRotation;
Vector2 normalisedVector;
// If we've reached our destination
if (TravelTo(currentLocation, targetLocation, out normalisedVector, out newRotation)) {
// We have now reached the 'next' node, and thus it is our current node.
currentPlayer.CurrentNode = currentPlayer.NextNode;
return (!reversing && currentPlayer.RollAmount == 0) ? new[] {this} : null;
return null;
}
currentPlayer.Location += normalisedVector * MoveSpeed;
currentPlayer.Rotation = newRotation;
gameInfo.PanCameraToObject(new CameraTarget(gameInfo.CurrentPlayer));
return new IGameState[] { this };
}
示例2: PathChosen
private void PathChosen(Node selectedNode, GameInfo gameInfo, IGameState waitState)
{
gameInfo.ClearTargets();
gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
var currentPlayer = gameInfo.CurrentPlayer;
currentPlayer.NextNode = selectedNode;
gameInfo.Fsm.Remove(waitState);
}
示例3: PathChosen
private void PathChosen(Node selectedNode, GameInfo gameInfo, IGameState waitState)
{
gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
var currentPlayer = gameInfo.CurrentPlayer;
// Teleport them
currentPlayer.CurrentNode = selectedNode;
currentPlayer.Location = selectedNode.GetTravelPosition(gameInfo.CurrentPlayerIndex,
gameInfo.TotalPlayers);
gameInfo.Fsm.Remove(waitState);
}
示例4: PerformLogic
public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo)
{
var spinnedNumber = gameInfo.Spinner.SpinnedNumber;
gameInfo.ClearTargets();
gameInfo.CurrentPlayer.RollAmount = spinnedNumber;
gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
switch (spinnedNumber) {
case 1:
return new[] {StateFactory.GetState(GameStates.ChangeWorld)};
case 10: return gameInfo.GameRuleType == GameRuleType.Retirement ? new[] { StateFactory.GetState(GameStates.IncreaseAge) } : null;
}
return null;
}
示例5: TravelToNodes
public static void TravelToNodes(List<Node> possibleNodes, GameInfo gameInfo, MouseDown<Node> callback, bool createCameratTargets = true)
{
gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
gameInfo.CreateMessage("Choose your destination!");
_cleanupCallback = (node, location) => CleanUp(node, location, gameInfo);
_callback = callback;
_possibleNodes = possibleNodes;
foreach (var possibleNode in possibleNodes) {
possibleNode.RememberColorState(ColorState.Glow);
possibleNode.SetColorState(ColorState.Glow);
possibleNode.ListenMouseDown += callback;
possibleNode.ListenMouseDown += _cleanupCallback;
if (createCameratTargets) {
gameInfo.AddLowPriorityTarget(possibleNode);
}
}
}
示例6: PerformLogic
public override IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo)
{
if (redStory != null && blackStory != null) {
var newLogicStates = CardSelected(gameInfo.Manager, gameInfo, gameInfo.Spinner.IsBlack ? blackStory : redStory);
blackStory = redStory = null;
return newLogicStates;
}
var possibleStories = Data.StoryCardData.PopulateStoryCards();
var shuffledStories = possibleStories.OrderBy(i => Guid.NewGuid());
redStory = shuffledStories.First(i => i.StoryType == StoryType.Red);
blackStory = shuffledStories.First(i => i.StoryType == StoryType.Black);
gameInfo.PanCameraToObject(gameInfo.Spinner);
CreateFirstDisplayWindow(gameInfo.Manager, gameInfo, redStory, blackStory);
waitState = StateFactory.GetState(GameStates.GameStates.Wait);
return new[] { this, gameInfo.Spinner, waitState };
}
示例7: TakeExamLogic
private IGameState[] TakeExamLogic(GameInfo gameInfo)
{
gameInfo.CreateMessage("Time for your exam! Spin the spinner!");
gameInfo.PanCameraToObject(gameInfo.Spinner);
return new[] { this, StateFactory.GetState(GameStates.GameStates.Spin) };
}
示例8: NodeChosen
private void NodeChosen(Node node, GameInfo gameInfo, IGameState waitState)
{
gameInfo.Fsm.Remove(waitState);
gameInfo.ClearTargets();
gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
var currentPlayer = gameInfo.CurrentPlayer;
currentPlayer.NextNode = node;
// Give the player a passport for the island they are going to arrive at
var assetResponse = currentPlayer.Accept(new PassportStamp(((Travel)node.BindedLogic.PureLogic).IslandType));
// Give the player a car modification if required
currentPlayer.SetTransport(TransportType);
if (assetResponse == AssetResponse.CollectedAllPassportStamps) {
if(gameInfo.GameRuleType == GameRuleType.Passport) {
gameInfo.Fsm.LazyPush(StateFactory.GetState(GameStates.GameStates.EndGame));
}
}
gameInfo.CreateMessage(String.Format("You have been given a {0} passport token!", IslandType));
gameInfo.Fsm.Push(StateFactory.GetState(GameStates.GameStates.VisuallyMovePlayer));
}