玩家1按a键,玩家2按L键
using System;
namespace _02_demo
{
class Program
{
/*
* 0代表地图格子□
* 1代表幸运盘◎
* 2代表地雷☆
* 3代表暂停▲
* 4代表时空隧道卐
*/
public static int[] map = new int[100];
//玩家位置
public static int[] player = new int[2];
//玩家姓名
public static string[] name = new string[2];
//回合数
public static int bout;
//玩家暂停数
public static int[] pause_bout = new int[2];
//游戏结束
public static bool over = false;
//胜利玩家
public static string winner;
public static readonly int[] luck = { 6, 23, 40, 55, 69, 83 }; //幸运转盘
public static readonly int[] landmine = { 5, 13, 17, 33, 38, 50, 64, 80, 94 }; //地雷
public static readonly int[] pause = { 9, 27, 60, 93 }; //暂停
public static readonly int[] tunnel = { 20, 25, 45, 63, 72, 88, 90 }; //时空隧道
static void Main(string[] args)
{
GameTitel(); //输出游戏标题头
InputName(); //让玩家输入姓名
InitialMap(); //初始化地图
//玩家开始游戏
for (bout = 0; ; bout++){
Console.Clear(); //清屏
DrawMap(); //画地图
StartGame(bout);
//判断是否可以结束游戏
if (over==true)
{
break;
}
}
Console.WriteLine("恭喜{0}玩家取得最后胜利!!!", winner);
}
/// <summary>
/// 输出游戏标题头
/// </summary>
public static void GameTitel()
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("*************************");
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("*************************");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Wr