Playing Card Demo

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Playing Card Demo

Post by Ref »

Re-inventing the wheel.
Want to create a number of card games sooo... need some playing card functions.
Result - a preliminary card library.

Code: Select all

local c = require 'cards'
and

Code: Select all

deck, order = c:createDeck()
returns:
a deck of 52 cards (quads)
order - a table of 52 randum numbers
The order in deck is:
1-13 are clubs (A 1 2 3 4 5 6 7 8 9 10 J Q K )
14-26 are diamonds
27-39 are spades
40-52 are hearts
Some other preliminary functions are provided for the display of the cards.
Edit: Changed dealing with a tweening function (outQuint).
Attachments
playingCards2.love
Changed 'deal' to outQuint_deal
(89.88 KiB) Downloaded 101 times
playingcards.love
Simple source for playing cards
(89.63 KiB) Downloaded 85 times
User avatar
xXxMoNkEyMaNxXx
Party member
Posts: 206
Joined: Thu Jan 10, 2013 6:16 am
Location: Canada

Re: Playing Card Demo

Post by xXxMoNkEyMaNxXx »

No way. I had the exact same idea, except I only wrote documentation for a library that doesn't exist. Cool!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 55 guests