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…
HTML5 Deck of Cards
71–80 of 165 posts
Re: HTML5 Deck of Cards
#72Re: HTML5 Deck of Cards
#73Earlier 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.
Re: HTML5 Deck of Cards
#74This 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…
Re: HTML5 Deck of Cards
#75Re: HTML5 Deck of Cards
#76Re: HTML5 Deck of Cards
#77This 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…
Re: HTML5 Deck of Cards
#78Earlier 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 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
#79Earlier 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.