Microsoft MakeCode

Playing Cards Extension

I’ve created an extension that can represent playing cards. It has poker, pinochle, and euchre decks built-in, plus the ability to create shoes (à la blackjack). You also can create your own, custom decks! See the code in the sample project for more information on that. In that sample project, I build a deck of cards for the wonderful card game called Rook.

The card images are built on-the-fly as you need them, so there isn’t as much overhead compared to rendering all of the images when the deck is created. If you are only showing a few cards on the screen at a time, you should only be using up the memory required to display those cards on the screen (plus a little bit of overhead to represent the card “bases” for each suit).

The extension is JavaScript-only for now. Card games are often a bit complex, and JavaScript seems like an appropriate environment for creating these games. Besides, the blocks interface definitely did not like this library. It works in Blocks, now, too! :slight_smile: See reply later for more information.

Extension URL (for importing into your projects):https://github.com/robo-technical-group/pxt-arcade-playing-cards.git

See it in action here:

Let me know if you find any errors or have any suggestions for enhancements. Have fun!

8 Likes

Another great one from the master!

1 Like

Thanks, @Gus!

Basic functionality is now working in the Blocks interface.

See the Blocks interface in action here:

Or, play a quick game of Acey Deucey here:

Use this URL to import my code from GitHub: https://github.com/robo-technical-group/acey-deucey

Have fun! Happy Monday!

3 Likes

Can’t wait to making something with this…

1 Like

I got up to 9 on Acey Deucy, fun game!

edit: 18!

1 Like

@Vidget, there are a few code snippets in the README.md file. You also can get code samples of much of the extension’s functionality out of the sample projects that I’ve posted in this thread. If something doesn’t make sense, just let me know. If you have any bug fixes or suggestions, I’d love to hear about them!

Also, the Blocks interface doesn’t have all of the functionality exposed. The get the full functionality (e.g. custom card decks), you’d need to switch to JavaScript.

2 Likes

Could you try to republish this one with the latest beta?

I’ve re-published Acey Deucey with the latest version of GitHub Pages. Should be all set, Peli. If not, just let me know.

can we expect a Freecell for Arcade soon? :wink:

1 Like

Looking great. I have been tagging posts with extensions and collecting them.

High score 6!

1 Like

Ooh … don’t make me start on another project, @gbraad! :smiley:

Acey Deucey was the simplest card game that I could think of, but additional solitaire games are an interesting thought. What do y’all think: What is the simplest solitaire game that you can think of, as far as game play is concerned?


I’ve noticed the new tags, @peli. Thanks for that! It’ll help us find games, extensions, and authors as this community continues to grow.

2 Likes

Yes we’re using “extension” to tag post about them. It’s going to be our preferred way to advertise an extension in Arcade…

1 Like