Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Simulating playing cards is surprisingly hard.

Doing so flawlessly at consistent 60fps in a mobile browser is quite the feat, don't you think?



Can someone explain what the technical challenges are? On first glance this seems like something one could implement on a weekend, I am sure that's not the case.


You can review the source code right here:

https://github.com/deck-of-cards/standard-deck

I'm not sure that there are many technical challenges. It's 10k lines of Javascript, and a ton of that are curly braces or blank whitespace lines.

I certainly don't want to knock the author here. This IS a neat and satisfying little project. But I have to agree with a comment elsewhere in this sub-thread, pointing out that teenagers were making advanced 60fps video games with Flash back in the 1990's.

Between Flash dying, and VB 6 dying, it feels like the ability for community members to simply MAKE SHIT has eroded tremendously. To be fair, a lot of this has to do with Windows declining as a monopoly desktop platform, and the rise of mobile as an alternate platform. Cross-platform is hard, especially across wildly different form factors and user interface types.

But even so, I miss the days of people showing off cool shit all the time. Stuff you could touch, play with, use. Today the showcase is mostly libraries "written in Rust!", that you can use to build other libraries written in Rust. Along with half-baked tools like Flutter and React Native, that are eternally "one year away" from being suitable for desktop apps, and kinda suck compared to the tools we had decades ago.


I'm the author of Deck.of.Cards, actually did the first version with Flash back in 2008. I started with Flash back in 1999, working in major ad agencies, and nowadays work as fullstack JS developer / entrepreneur.

This project is just a small experiment of mine, wanted to fiddle around with nicer shuffle animation than what's usually seen, and inspire others as well by sharing the source code.

I've also done https://car.js.org for example, and https://flanets.io – those as well just small side experiments..

But ya, i have to agree we used to see more creative stuff when Flash was still around, and that is sad.


I assume the Deck of Cards tool was no easier to implement in Flash than in JS?


Well graphics were easier to do as MovieClips, but otherwise not that much of a difference. Maybe overall easier with DOM actually..


It wasn't surprisingly hard back when Flash wasn't ripped from all browsers.


Only if you ignore the flawlessly at 60 fps part.


And the mobile browser part.


Or even the desktop browser part. If you were on Windows or a Mac, maybe you had access to Flash player.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: