0

I am currently thinking about the best multi-platform language to build a multiplayer app with, and I was just wondering if anyone knows if AIR supports multiplayer locally between devices i.e over a LAN or bluetooth? Would I need to run some aspects of the game via a server?

Not to give too much away (of the game idea) but it would be similar to a "Simon" type game, with the only info being passed to each device either a score/amount of moves to beat or other simple piece of data.

Thanks

3 Answers3

2

Adobe AIR supports the ServerSocket class so yes it's more than possible.

Edit
As @davivid accurately pointed out, ServerSocket doesn't seem to be implemented on mobile devices. You're not SOL here though, you can use Native Extensions or AIR and still accomplish your end goal. See this official adobe page for more info and a ton of downloadable examples.

  • 1
    I don't think `ServerSocket` is supported on mobile devices – davivid Apr 16 '12 at 09:55
  • Ohh that's a good point @davivid, I remember reading that. Well, you can still accomplish this by using AIR native extensions for Android and just write a simple socket server and client in Java. There are plenty of examples on that. –  Apr 16 '12 at 15:52
2

Multiplayer on devices connected to the same local network is supported in Adobe AIR including iOS and Android. You use NetConnection.connect().

Example with source code.

Miha
  • 301
  • 2
  • 8
2

If you are developing on iOS. It is best to use GameKit that came with iOS. GameKit is also connected to GameCenter. So, players can challenge their friends close to them or play against someone over the Internet. This is all handled for you by the API, so you don't need to worry about matchmaking or even low level socket communications.

AIR doesn't support GameKit out of the box, but there are some Native Extensions that support Multiplayer Gameplay. The one I use is at: http://airextensions.net/shop/extensions/game-kit-by-vitapoly/

Mark
  • 21
  • 1