Skip to main content
added 121 characters in body
Source Link
user94720
user94720

I'm making a 1v1 game with each player at one end of the screen. The game is an online client-server game. I would like eachthe local player to be on the left side of their screen and their opponent on(the remote player) on the right side. Similar to Clash Royale where the local player is always on the bottom and their enemy always on top.

What is the easiest way for me to accomplish this?

Some solutions I've thought of so far:

  1. The server checks every time it sends data back to the players that if it's sending the data back to player 2, it flips it before sending it back. I don't particularly like this solution because it will greatly complicate the code, increasing the chances of bugs, and make it less flexible / re-usable in the future.
  2. The client checks if it is player 2 and flips the data it received back from the server if it is. I don't like this solution for the same reasons as above.
  3. Some camera tricks I don't know about.

I'm making a 1v1 game with each player at one end of the screen. The game is an online client-server game. I would like each local player to be on the left side of their screen and their opponent on the right side.

What is the easiest way for me to accomplish this?

Some solutions I've thought of so far:

  1. The server checks every time it sends data back to the players that if it's sending the data back to player 2, it flips it before sending it back. I don't particularly like this solution because it will greatly complicate the code, increasing the chances of bugs, and make it less flexible / re-usable in the future.
  2. The client checks if it is player 2 and flips the data it received back from the server if it is. I don't like this solution for the same reasons as above.
  3. Some camera tricks I don't know about.

I'm making a 1v1 game with each player at one end of the screen. The game is an online client-server game. I would like the local player to be on the left side of their screen and their opponent (the remote player) on the right side. Similar to Clash Royale where the local player is always on the bottom and their enemy always on top.

What is the easiest way for me to accomplish this?

Some solutions I've thought of so far:

  1. The server checks every time it sends data back to the players that if it's sending the data back to player 2, it flips it before sending it back. I don't particularly like this solution because it will greatly complicate the code, increasing the chances of bugs, and make it less flexible / re-usable in the future.
  2. The client checks if it is player 2 and flips the data it received back from the server if it is. I don't like this solution for the same reasons as above.
  3. Some camera tricks I don't know about.
Source Link
user94720
user94720

Flipping the game so that the local player is always on the left side of the screen?

I'm making a 1v1 game with each player at one end of the screen. The game is an online client-server game. I would like each local player to be on the left side of their screen and their opponent on the right side.

What is the easiest way for me to accomplish this?

Some solutions I've thought of so far:

  1. The server checks every time it sends data back to the players that if it's sending the data back to player 2, it flips it before sending it back. I don't particularly like this solution because it will greatly complicate the code, increasing the chances of bugs, and make it less flexible / re-usable in the future.
  2. The client checks if it is player 2 and flips the data it received back from the server if it is. I don't like this solution for the same reasons as above.
  3. Some camera tricks I don't know about.