Giter Club home page Giter Club logo

solitaire's Introduction

Solitaire

To play the games, visit the live version.

For user-oriented information, please see the FAQ.

There is also a Lua/Corona SDK version of this at the Google Play Store.

Implementation

Written in vanilla ES2017 Javascript, formatted as per the Google style rules with JSDoc annotations to try to keep the Visual Studio Code type checker quiet.

Implemented as a small hierarchy of classes; a Card class and a Pile class, with classes derived from that for Stock, Waste, Foundation, Tableau &c. Some specialized piles, for example a Freecell tableau, get derived.

Each variant has it's own html file which contains layout information for each pile and gameplay rules for that variant. The html file consists of boilerplate header and footers, wrapped at build time around a central guts file and some SVG symbols. The build script (bake.tcl) requires Tcl to be installed and is hardwired to my folder configuration.

At run time, the layout information in the html is linked to the Javascript pile classes.

The graphics are implemented in SVG, so they scale smoothly.

Time has been spent making it compatible with both mobile and desktop versions of Chrome, Firefox and Edge. I think it runs The Best on a touchscreen Chromebook.

Philosophy

Keep it simple and facilitate the player's flow. So: no distracting graphics or animations, make the cards easy to scan visually, and no unnecessary features.

Also, make the games authentic, by taking the rules from reputable sources and implementing them exactly.

Known problems

  • Redeals and scorpion/spider symbols not displaying on a Chromebook. There's an open issue on the chromium tracker that relates: https://bugs.chromium.org/p/chromium/issues/detail?id=914919

  • Cards sometimes don't animate, so the card is displayed where it started, but the software thinks it's somewhere else. Can be cleared by reloading the page. May be linked to grabbing a moving card?

  • Dragging cards goes through phases of being unreliable, as browsers get updated. It's caused when the user agent sends an unwanted pointercancel event. It's currently fixed by having dummy touch start/move/end listeners so all the touch events get ignored.

solitaire's People

Contributors

oddstream avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

solitaire's Issues

Flip Flop (Online)

Stock and Waste are too far down.

I cannot get Stock and Waste on the screen
together with the Foundations and Tableaus.
(Tested on FullHD Screen)

Mrs. Mop (Android)

Three versions of Mrs. Mop and not the original?
I personally don't like to play Kings on Aces.

Good game

Okay, this is the issue section,
but i want to say thanks for the good work.
The game is very fast and has good visibility
on my android tablet and smartphone.

time to detect tapping on screen (Android)

Is it possible to set the time it takes to distinguish an automatic move and a wanted move from one pile to the next?

On my tablet, tapping to force auto-moves by the computer works good, but on my faster smartphone it works only if i'm tapping very fast and short.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.