示例#1
0
        public void move(ConnectionToServer conn, Cell nextMove, int currentX, int currentY)
        {
            if (nextMove.x == currentX + 1) { conn.sendData("RIGHT#"); }
            else if (nextMove.x == currentX - 1) { conn.sendData("LEFT#"); }
            else if (nextMove.y == currentY + 1) { conn.sendData("DOWN#"); }
            else if (nextMove.y == currentY - 1) { conn.sendData("UP#"); }

            Thread.Sleep(1000);
        }
示例#2
0
文件: Game1.cs 项目: TeamViperz/Tanks
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     game = new Game2();
     myConnection = new ConnectionToServer(game);
 }
示例#3
0
 public Joystick(ConnectionToServer connectionToServer)
 {
     this.connectionToServer = connectionToServer;
     InitializeComponent();
 }