aod / zhithead Goto Github PK
View Code? Open in Web Editor NEWZhithead is a clone of the original card game shithead made for the browser
Home Page: https://zhithead.yatko.dev
License: MIT License
Zhithead is a clone of the original card game shithead made for the browser
Home Page: https://zhithead.yatko.dev
License: MIT License
Firefox and I'm sure other browser give the same warning when using preload
and not using the resource soon after:
Either way, this was a hack for when the bot is playing a card or human is taking a card from the deck. The animation would be in progress while at the same time the browser would load the card image. This would mess up the animation.
Clearly it's not desirable for the player to preload every card asset in their browser. So this should get fixed, eventually...
One possible fix is to bundle the SVGs by importing/exporting them in a module. This will increase the bundle size. The total uncompressed size of all card assets is 2.66 MB.
Another solution could be looking at the top X cards of the deck and "preloading" the assets. Even only preloading the top most card of the deck should be good enough. The biggest card size with a face is 266 KB and non-face cards are ~15 KB.
Although depending on the player's internet stability bundling might be the better option. And also when the player goes offline they wouldn't be able to load further card assets.
Just an interesting idea of encoding the game state in the URL. This would allow the player to go back and forwards to undo and redo their moves and also share the URL. It really sounds like a gimmick but it's interesting for me nonetheless.
One con I can think of would be that the player would have infinite redo and undos. But I think the goal is not to make a perfectly balanced game, I think that would take more time and effort. It's primarily about having fun and also exploring interesting concepts and learning as much as I can from this.
It'd be amazing if I could sort my hand. Either manually (dragging cards) or with a dedicated "sort" button.
The bot currently doesn't play multiple cards at all. There should be a random chance of the bot playing multiple cards when possible.
Things to change:
Lines 8 to 15 in 8399216
Return an amount of cards when possible at a random chance.
zhithead/src/state/services/bot.service.ts
Lines 17 to 25 in 8399216
Use that value returned by the bot function and pass it to the state machine.
If a face-down card has been played and it's an "invalid" card you can keep playing your other face-down cards.
Loving your work so far! It's a really smooth experience and great fun to play around with.
I'm not sure if this is an official rule, but I've always played with the ability to pick up the pile at will, rather than having to play through until you can't play any more cards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.