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); }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; game = new Game2(); myConnection = new ConnectionToServer(game); }
public Joystick(ConnectionToServer connectionToServer) { this.connectionToServer = connectionToServer; InitializeComponent(); }