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