# Playing Cards Extension

**URL:** https://forum.makecode.com/t/playing-cards-extension/98
**Category:** Arcade
**Tags:** extension
**Created:** [March 21, 2019, 10:44pm UTC](https://forum.makecode.com/t/playing-cards-extension/98 "2019-03-21T22:44:02Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [March 21, 2019, 10:44pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/1 "2019-03-21T22:44:03Z")

</div>

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! 🙂 See reply later for more information.

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

See it in action here:

> **[Playing Cards Extension Playground](https://arcade.makecode.com/06477-59658-17680-87628)**
>
> Made with ❤️ in MakeCode Arcade.

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

---

<div class="post-metadata">

### Author: ![Gus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gus/32/28_2.png) [@Gus](https://forum.makecode.com/u/Gus)
#### Post date: [March 22, 2019, 11:44am UTC](https://forum.makecode.com/t/playing-cards-extension/98/2 "2019-03-22T11:44:20Z")

</div>

Another great one from the master!

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [March 26, 2019, 1:32am UTC](https://forum.makecode.com/t/playing-cards-extension/98/3 "2019-03-26T01:32:30Z")

</div>

Thanks, @Gus!

Basic functionality is now working in the Blocks interface.

See the Blocks interface in action here:

> **[Playing Cards Blocks Playground](https://arcade.makecode.com/10700-36515-48741-57622)**
>
> Made with ❤️ in MakeCode Arcade.

Or, play a quick game of Acey Deucey here:

> **[acey-deucey](https://robo-technical-group.github.io/acey-deucey/)**
>
> Acey Deucey variant for MakeCode Arcade

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

Have fun! Happy Monday!

---

<div class="post-metadata">

### Author: ![Vidget](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vidget/32/29_2.png) [@Vidget](https://forum.makecode.com/u/Vidget)
#### Post date: [March 27, 2019, 2:17pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/4 "2019-03-27T14:17:02Z")

</div>

Can’t wait to making something with this…

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [March 27, 2019, 4:14pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/5 "2019-03-27T16:14:11Z")

</div>

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

edit: 18!

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [March 27, 2019, 5:32pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/6 "2019-03-27T17:32:13Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [March 7, 2020, 5:41am UTC](https://forum.makecode.com/t/playing-cards-extension/98/7 "2020-03-07T05:41:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [March 7, 2020, 9:58pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/8 "2020-03-07T21:58:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gbraad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gbraad/32/338_2.png) [@gbraad](https://forum.makecode.com/u/gbraad)
#### Post date: [March 8, 2020, 2:47am UTC](https://forum.makecode.com/t/playing-cards-extension/98/9 "2020-03-08T02:47:14Z")

</div>

can we expect a Freecell for Arcade soon? 😉

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [March 8, 2020, 4:40pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/10 "2020-03-08T16:40:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![nayrbgo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nayrbgo/32/668_2.png) [@nayrbgo](https://forum.makecode.com/u/nayrbgo)
#### Post date: [March 8, 2020, 7:21pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/11 "2020-03-08T19:21:01Z")

</div>

High score 6!

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [March 9, 2020, 7:48pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/12 "2020-03-09T19:48:35Z")

</div>

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

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.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 4, 2020, 1:35pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/13 "2020-04-04T13:35:58Z")

</div>

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

---

<div class="post-metadata">

### Author: ![top\_hat\_lord](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/top_hat_lord/32/33469_2.png) [@top\_hat\_lord](https://forum.makecode.com/u/top_hat_lord)
#### Post date: [June 21, 2024, 12:37am UTC](https://forum.makecode.com/t/playing-cards-extension/98/14 "2024-06-21T00:37:22Z")

</div>

okay, I need some help here. I know this topic hasn’t been used in a while from the notification next to me, but I need to know, how do you make new cards?!?! I’m trying but its so complicated, and there’s no tutorial’s on it here. could anyone help?

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [June 21, 2024, 12:44am UTC](https://forum.makecode.com/t/playing-cards-extension/98/15 "2024-06-21T00:44:21Z")

</div>

The only way right now to change the card design is to use JavaScript. There aren’t any blocks to change card designs.

If you are comfortable with programming in JavaScript, then take a look at the code in the playground (first post) to see how I built the deck for the card game _Rook_. It shows how to create a custom deck.

---

<div class="post-metadata">

### Author: ![top\_hat\_lord](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/top_hat_lord/32/33469_2.png) [@top\_hat\_lord](https://forum.makecode.com/u/top_hat_lord)
#### Post date: [June 21, 2024, 2:59pm UTC](https://forum.makecode.com/t/playing-cards-extension/98/16 "2024-06-21T14:59:26Z")

</div>

thanks!
