Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting two devices using libgdx

I'm developping a video game on both pc and android using libgdx. And i would like to connect them by Wifi or Bluetooth on a local network. The idea is to play in p2p, establishing this connection easily. Please anyone can give help or source code for that, knowing that the connections can be : android/android but also PC/PC (since libgdx allows that)? I have absolutely no idea.

Thanks

like image 225
Chayem Samy Avatar asked Jan 15 '23 01:01

Chayem Samy


1 Answers

Well because libgdx doesn't have good networking support you can write your own, but i've found that Kryonet is very good. It takes a lot of the hassle out of writing the network layer of your application and I've used it to connect mobile and desktop with no problems. Definably worth a quick view. It also has some good examples to get your up and running with a network game too.

I've also found this article by valve very usefull.

like image 169
joey.enfield Avatar answered Jan 22 '23 16:01

joey.enfield