Implementing Multiplayer into Card Game

Hey everyone! New-ish coder here starting to do some multiplayer games. To begin, I would like to know what multiplayer plugin you use, and why? Secondly, I would like to know how I can share a lua table among the two players, so that that each player does not get the same objects. (cards) I’m completely lost on how to do multiplayer, is there a good tutorial I could read or watch? I can’t seem to find one.

Here is the basic code I have for creating a full deck, and making one card in one of the hands.

 function createDeck() deck = {} for i=1, 4 do for j=1, 13 do local tempCard = suits[i]..j table.insert(deck,tempCard) end end end function generateHand1() local randomCard = math.random(#deck) hand1 = display.newImage("resources/"..deck[randomCard]..".png") hand1.cardNumber = tonumber(string.sub(deck[randomCard],2,3)) hand1.cardSuit = string.sub(deck[randomCard],1,1) table.remove(deck, randomCard) hand1.x = 215 hand1.y = 275 print(hand1.cardNumber) return hand1 end

Look into Coronium.io . Few threads on this forum about it as well. Search for Coronium. It has all the capability you need and is very easy to setup and get going. 

Thanks I’l go check it out now!

I’ve been trying this out for a bit now but i still don’t understand how I can get two phones to connect, and have them both send and receive inputs & outputs. And will this support having multiple instances running? Such as 6 phones playing 3 different games?

What the videos by @develephant (developer of Coronium) and see how you can connect and easily write and read from your Coronium cloud. No limits of devices and instances / apps etc. It is as easy as it gets. 

Look into Coronium.io . Few threads on this forum about it as well. Search for Coronium. It has all the capability you need and is very easy to setup and get going. 

Thanks I’l go check it out now!

I’ve been trying this out for a bit now but i still don’t understand how I can get two phones to connect, and have them both send and receive inputs & outputs. And will this support having multiple instances running? Such as 6 phones playing 3 different games?

What the videos by @develephant (developer of Coronium) and see how you can connect and easily write and read from your Coronium cloud. No limits of devices and instances / apps etc. It is as easy as it gets.