18 Dec 19:13
Eights SVG
Jason McIntosh <jmac <at> jmac.org>
2004-12-18 18:13:56 GMT
2004-12-18 18:13:56 GMT
I have published a new SVG UI for Crazy Eights, intended to serve as a model for more sophisticated UI files. Not optimally pretty, but it does the job. At the moment, it's primarily lacking card-play animation, so cards blink into place when played, instead of sliding smoothly into the discard pile; I have yet to get the hang of script-based animation. The file does, however, manage to demonstrate simple user feedback, such as the onmouseover actions attached to the cards in hand, the use of color in the scorecard to indicate whose turn it is, and the presence of eye candy (a "Loading..." message) during the interval between the player clicking "start game" and the client receiving and rendering all the setup information. It's registered with the bookkeeper, so if you build Javolin (via CVS) and create a table at eights <at> volity.net/volity, the file will automagically load. It's also checked into CVS under the games-ui module, and you can just look at the thing yourself by downloading it from http://volity.org/games/eights/svg/eights.svg . The comments point out some places I had trouble with; any of y'all that know ECMAScript better than me (not saying much) should feel free to make repairs. The big mess at the start is an SVG font definition for the suit symbols, which I ripped off from an Apple typeface. Then the file goes on to define 55 <symbol> elements for the whole deck (inlcuding two jokers and the card back) before going on to the eights-specific symbols and functions. For the sake of laziness, they're all in the same file, but I see a future where UI files will instead pull in common components like card decks , and perhaps even function libraries, through external entity references (an XML feature that lets(Continue reading)
RSS Feed