Project: playing card library

The aim is a self contained library of Codea code that makes it easy to implement 2D playing cards in projects.

Latest developments will always be in this top post, above the discussion thread. It is in fairly early stages. So far, it can generate a pack of realistic cards and lay them on the table. See images/video below.

If you are interested in helping with ideas or code, or in using it, please contact me.

Latest development code posted 18/3/13: (Updated)

Im pretty sure that hasnt been done yet, I had the same sort of idea to make a poker game but I want to make 3d cards not a 2d top down game, I wouldnt mind helping though

Have a think about the sorts of useful functions a card library might have and let me know. It might be an idea to look at similar libraries in other languages for ideas. I’m also wondering what to do about the royalty cards.

I’ll post my code once I’ve cleaned it up a bit. I’d like it to be as small and clean as possible, generating images for the whole pack on starting up, perhaps.

Yeah ill take a look around, once I know how far you’ve gotten i suppose I could help you from where you are, I was thinking and you might have already done it but the card creation being in setup indexing the 52 cards in to 4 tables so then its easy to index the cards when you use them

I’ll post my current code in the morning (it’s evening now), I’ve got quite far.

I can deal cards in columns and rows like this.

And play a game like 21 (at a basic level). I have parameters controlling the gameplay, unfortunately those don’t appear in the video.

The deck is completely built from code, using images from Emoji (apart from the card back, which can be anything you want).

I’ll explain how it’s all put together, and lets see where we can go from there.

Alright, that looks pretty good anyway and the stacking looks good, but yeah when you’re ready I’ll check it out and see what ideas i got

See code here

Updated. Patience game now includes dragging of cards between columns.

I would suggest to add some animations to the cards, and actually have them deal out from the deck using tweens(). The cards look pretty good, but its just lacking some of that extra pazaz

I know, but crawling comes before walking!