I have a game called wizard wars that I have been working on. This game needs to allow 2 players to play at one time, and would need a TCP connection to communicate spell creation/destruction ect., and a UDP connection to handle locations ect. It would have a client and a host side. That being said my program is designed to run on Android. All of the tutorials/information I have found online has been for JApplets or something like that. So what I would like is some help with ever short code examples of how to set up/use connections, or just a link to some sufficiently helpfull information on how to set up the actual connections.
Java libgdx(desktop/android) multiplayer game how to
Have you looked at LibGDX with KryoNet? –
Josphinejoss
Not yet, but ill look into it. –
Bronk
The best approach (or at least 1 approach) would be to use normal HTTP requests : http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Net.html
You create a webservice implementing REST and create calls for both updating and consuming data.
Alternatively, if you're just going to use Android and Desktop you may also use WebSockets : https://github.com/pepedeab/libGDX-Net
Can WebSockets not be used with html5? –
Walking
For those who don't read comments, but still looking for tcp client.
You can use KryoNet which supports Desktop and Android https://github.com/EsotericSoftware/kryonet
Have you guys looked at the multiplayer super jumper tutorial? Its written using AppWarp and is being actively used in the libgdx community as well.
Thx dude! This seems to be exactly what I am looking for! –
Bandung
© 2022 - 2024 — McMap. All rights reserved.