Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void MovePlayer(int PlayerNo, int Distance, char Direction)
- {
- for (int i = 0; i < AmountOfPlayers; i = i + 1)
- {
- PlayerNo = i;
- Distance = DiceThrow();
- Direction = Console.ReadKey().KeyChar;
- Console.WriteLine("U = up D = down R = right L = left");
- switch (Direction)
- {
- case 'U':
- Players[PlayerNo].Y = Players[i].Y - Distance;
- if (Players[i].Y < 0)
- {
- Players[i].Y = Players[i].Y + 8;
- }
- break;
- case 'D' :
- Players[PlayerNo].Y = Players[i].Y + Distance;
- if (Players[i].Y < 0)
- {
- Players[i].Y = Players[i].Y - 8;
- }
- break;
- case 'L':
- Players[PlayerNo].X = Players[i].X - Distance;
- if (Players[i].X < 0)
- {
- Players[i].X = Players[i].X + 8;
- }
- break;
- case 'R' :
- Players[PlayerNo].X = Players[i].X + Distance;
- if (Players[i].X < 0)
- {
- Players[i].X = Players[i].X - 8;
- }
- break;
- default :
- Console.WriteLine("Please use U D R or L for as movement characters.");
- continue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement