Live data from Hacker News

HTML5 Deck of Cards

pakastin.github.io

71–80 of 165 posts

Re: HTML5 Deck of Cards

#71

This is similar to something my room mate is working on: https://github.com/thejoshwolfe/board-gamer-2d The user can create a JSON string that represents a game (checkers, solitare, dominion, smash up, etc). Then the engine creates cards, tokens, dice, etc. It does not enforce rules but it supports multi player and some rules about visibility to other players. Its intended use case is for testing out new games or exp…

This seems to be all static html, why doesn't he just turn the branch into a github page?

Re: HTML5 Deck of Cards

#73
post #38

Earlier quoted context omitted.

It's done in CSS3 + JS, so it should be pretty easy. https://desandro.github.io/3dtransforms/examples/card-01.htm... #card.flipped { -webkit-transform: rotateY( 180deg ); -moz-transform: rotateY( 180deg ); -o-transform: rotateY( 180deg ); transform: rotateY( 180deg ); }

Sure but implementing the card back image is more difficult, which is what I think the parent post was getting at, rather than the flipping itself. The rest of the page is implemented without any images, which is neat; you'd have to work some SVG magic or something to create e.g. a Bicycle-esque card back without loading an image.

http://lea.verou.me/css3patterns/ could provide a pretty good source for patterned card backs.

Re: HTML5 Deck of Cards

#74

This is similar to something my room mate is working on: https://github.com/thejoshwolfe/board-gamer-2d The user can create a JSON string that represents a game (checkers, solitare, dominion, smash up, etc). Then the engine creates cards, tokens, dice, etc. It does not enforce rules but it supports multi player and some rules about visibility to other players. Its intended use case is for testing out new games or exp…

Hm, cool! My company just started on a Javascript board game engine where the server & client can share the same .js file for rules, and all logic for the game is encoded into the pieces (fat models) instead of controllers, allowing for easy customization and mods.

https://github.com/QuantumProductions/tic-tac-toe

Re: HTML5 Deck of Cards

#75
post #40

Earlier quoted context omitted.

I suck at pseudo-elements – that's why.. :)

Great work, I love this. Here is a quick playing card example with pseudo elemenets view-source: http://www.clarkeology.com/card.html

That’s nice CSS but the HTML is so borked… why not

Or something?

Re: HTML5 Deck of Cards

#77

This is similar to something my room mate is working on: https://github.com/thejoshwolfe/board-gamer-2d The user can create a JSON string that represents a game (checkers, solitare, dominion, smash up, etc). Then the engine creates cards, tokens, dice, etc. It does not enforce rules but it supports multi player and some rules about visibility to other players. Its intended use case is for testing out new games or exp…

This is what I've been wanting to make since I first learned about programming 3 years ago. So much effort goes onto enforcing rules, when really, all you need is the virtual pieces.

Re: HTML5 Deck of Cards

#78

Earlier quoted context omitted.

You can do this in PHP, but you shouldn't. Use (int), like C.

It is not much worse than using it in javascript. People do this in js because it saves a few keystrokes and its faster, not that it matters. Its a small thing. Its dirtier, for sure. I just tested it in PHP and it seems it is 20% faster in PHP compared to casting to int. Maybe someone out there will have a weird use case for that, or someone doesn't want to put more effort into writing code into terminal and doesn't…

> It is not much worse than using it in javascript.

It is worse because people are even less familiar with this in PHP. It's not idiomatic.

> I just tested it in PHP and it seems it is 20% faster in PHP compared to casting to int.

How rigorous was your testing? Which version of PHP were you using?

> It makes sense in javascript to that its faster than functions, but why it is faster than a cast in PHP?

It shouldn't be. It might save an allocation in older PHP versions, I'm not sure.

Re: HTML5 Deck of Cards

#79

Earlier quoted context omitted.

something to hook it up with : http://deckofcardsapi.com/

Okay, but that doesn't address that it still doesn't have faces on face cards, different numbers of suit icons on each card, etc. There are off-the-shelf stock photo sets that make it easier to tell the difference between the cards.

See the thing you don't get here is that none of what you say justifies posting these comments just to shit on something. It makes a negative contribution to the conversation, which HN explicitly does not want.
Post reply on HN