Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Using spritesheets for card games

Just a question : Where can I find information on using spritesheets ?
It would have to pick all 52 cards as spots on the sheet, then randomize them.
Deal a hand to the players.

Comments

  • dave1707dave1707 Mod
    Posts: 6,325

    Somebody just posted a spritesheet for a card deck. Try doing a forum search for spritesheet to see what shows up.

  • Posts: 57

    The sprites sheets look like their best used for animations. I have downloaded a deck of cards in .png file format...It would be best to create a helper class and use self to id each card, and then re-use the class for each new card game..

  • Posts: 102
    i like to store playing cards as a number. Get the rank by doing card%13, suit by card%4. To find the texCoord for a rect for example, you need to know the left bottom edge, the bottom edge, the height and the width of the card.

    If you have 14 columns but 13 ranks (say last column is some extra stuff), then your left edge is card%13 * (1/columns), with the width of the card being 1/columns..

    if you have five rows and four suits. bottom edge is card%4 * (1/rows

    hope that help still
  • Posts: 57

    I see a good sprite sheet example by se24vad... But it doesent seem to work. It was posted in 2014 ; https://codea.io/talk/discussion/4803/spritesheets-animation-in-codea.....Is it only me ? This would be a good idea for the card shuffle function...And would raise the quality of the card game...

  • Posts: 102

    actually looks interesting. hmm

Sign In or Register to comment.