I've been looking at this for a few hours now so I thought I'd bring it to you, as I've made no headway. The error occurring is that the game will simply jump out of the user's turn and jump straight into the code that allows the A.I to start determining what cards it can play (this happens in a function called Opponent_AI.OppPlayCards). It doesn't even start the function that does this, it simply jumps into it. I've included an image illustrating where this happens (white line). What should happen is after the AI has finished the process of playing a card the code changes turns, this part is appears fine as the
Code: Select all
It's Player 1's Turn
Code: Select all
OppPlayCards: UnPlayable: 1
QC
Also it's probably worth knowing the rules of the game, otherwise you might not get too far in it. Ace is high, and the aim is to get rid of all your cards before the AI does. You can play one at a time, or multiples if the ranks are the same. You can only play a card of equal or higher rank to the last one played, except in exception circumstances. These being when a 2 (resets the deck) or an 8 (a mirror of the card beneath it) are played. If a 7 is played then you have to play a card equal or lower than that, if a Queen is played then 2,7,8,10 cannot be played. Oh, and 10 'burns' the played card deck. If you can't play a card then you have to 'pickup' - there's a button for that.
The .love, and a zip of the Lua files have been attached. I wish I could give more information on this, but I have no idea what could be the cause so the best I can really do is provide you with the code and answer any questions you have about it.
Any help will be appreciated, this one is really driving me crazy!
Thanks.