четверг, 13 декабря 2012 г.

Classic Solitaire HD in Windows 8 Store

Some time ago I tried to port C# version Classic Solitaire HD from iOS/Mac to Windows 8. There were some issues with absence of System.Drawing namespace and not 100% compatible rendering pipeline (no frame-by-frame operations, only regular XAML objects) but overall porting came surprisingly easy.
That was mostly possible because of multi-layered architecture where game core was written in platform-independent style in Java and then converted to C# with Sharpen. Upper layer (GUI) slightly differs for each platform, but that is not an issue.
Hardest part was implementation of "jumping cards" cause in Win 8/RT world there is no way to get back drawing canvas image from GPU and paint on it once again. To solve this problem I used BitmapCache trick: I group N (let's say 100) jumping cards and move them to separate Canvas object that is set to use BitmapCache. Then Canvas is frozen and all painting is performed in new layer. Of course, we can run into performance and memory problems with lots of layers, but tests shows that modern CPUs/GPUs can handle more than 3000 cards in 20-30 layers without significant performance degradation. Well, that's funny - you need modern PC to play year's 89 game :)
I also implemented fancy settings menu and put in several retro and modern card decks.

There are two builds available: paid for $1.49 (that's weird, but MS set this as minimum price) and free with advertisings. Ads could be removed by entering promo-codes that I can surely give to my subscribers by request.


Paid, $1.49: http://apps.microsoft.com/webpdp/app/eec5728f-182f-4c7c-86ba-99c07ceb9a12
Free: http://apps.microsoft.com/webpdp/app/5b46dba6-eb7e-4baa-8e2b-a3e0aeaf5607

Also, there is nice review of Classic Solitaire HD from win8reviews.com:

And now, most funny part: porting to Win 8 and XAML also allowed me to made a port of this game to Silverlight by changing some namespaces and XAML bits. I put the game to Facebook page, however it lacks social features and full FB integration: