Skip to content

Commit

Permalink
Added power 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
redleek committed Dec 4, 2014
1 parent 52f251e commit b936964
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions TacticalSpaceCheeseRacer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,6 @@ static void SetupGame(bool reinitialise, bool use_old_names)
players = new Player[no_of_players];
ReadNames();
}
/*
bool player_nums_same = ReadYN("Use same number of players?: ");
if (player_nums_same)
{
Console.WriteLine("WARNING: Incomplete method parameter, still in development.");
return;
}
*/
}
else
{
Expand All @@ -236,6 +228,15 @@ static void SetupGame(bool reinitialise, bool use_old_names)
#endregion

#region Gameplay Functions
/// <summary>
/// Prints the current position of the specified player on the board.
/// </summary>
/// <param name="playerno">The current player playing.</param>
static void PrintPosition(int playerno)
{
Console.WriteLine("{0}'s new position on the board is {1}.", players[playerno].name, players[playerno].position);
}

/// <summary>
/// Generates a psuedo random number for a dice roll.
/// </summary>
Expand Down Expand Up @@ -267,7 +268,7 @@ static void PlayerTurn(int playerno)
#endif
Console.WriteLine("{0} rolled a {1}.", players[playerno].name, roll);
players[playerno].position += roll;
Console.WriteLine("{0}'s new position on the board is {1}.", players[playerno].name, players[playerno].position);
PrintPosition(playerno);
}

#region Tactical Dice Methods
Expand Down Expand Up @@ -309,10 +310,28 @@ static void Power3(int playerno)
{
if (players[playercount].position == current_player_position)
{

if (!(playercount == playerno))
{
players[playercount].position = 0;
Console.WriteLine("{0} has had their engines exploded and are now back to square 0.", players[playercount].name);
}
else
{
continue;
}
}
}
}

/// <summary>
///
/// </summary>
/// <param name="playerno"></param>
static void Power4(int playerno)
{
players[playerno].position += 6;
Console.WriteLine("{0} has moved to square {1}.", players[playerno].name, players[playerno].position);
}
#endregion
#endregion

Expand Down Expand Up @@ -352,6 +371,7 @@ static void Main(string[] args)
else
{
// Do tactical stuff later.
//PrintPosition(playercount);
}

Console.Write("Press enter to continue...");
Expand Down

1 comment on commit b936964

@redleek
Copy link
Owner Author

@redleek redleek commented on b936964 Dec 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added power 4.

Please sign in to comment.