Silverlight game loop – revisited for Windows 8 and Visual Studio 2012 RTM

I finally found the code I created when I ported Mike Snow’s Silverlight snowflake “game” into a Windows 8 C#/XAML “game.”   See

(Yes I had checked my Release Preview-based code into Team Foundation Service, but I couldn’t remember which project I’d put it in. And I’ve rebuilt all my machines onto RTM bits, so I didn’t have a local copy. But, there it was, sitting right where I’d left it on the server. I love the Team Foundation Service in the sky.)

OK. Where was I?

For some reason in my previous version when I created the project I wound up with the files that are included for layout aware pages. (Code that helps wire up a page to respond to Snapped, Filled, Portrait, and Landscape view changes.) Anyway, there was a change from RP to RTM that affected ApplicationViewStateChangedEventArgs and ApplicationView.GetForCurrentView(), both of which are used in LayoutAwarePage.cs…. One of those files that’s part of the layout aware pages code that your project can leverage.

I took the easy route and created a new Blank C# Windows Store Application and copied my code from the RP version into the new project. And it worked without any changes. So now I yet again have a running snowstorm game in Windows 8.

Time to write a game of my own: perhaps using the accelerometer to send the snow moving left or right, or using the Shake event to allow the user to make it look like a snow globe that’s been shaken. And of course I’ll add ways to do this via touch, keyboard or mouse, for those who don’t have those device sensors.

Stay tuned. . .

Comments (1)

  1. LMK says:

    Good info thanks.

    I have also been dabbling in writing 2D games for Win 8 XAML. Here's a couple of posts that may also be of use to any visitors:…/43bc5439-2db7-4271-a77f-0dd54d7c5795…/a08d91de-e1b7-474d-bb31-b2725093618e

    It's good to see others looking at XAML/.Net for 2D games, seems to me that despite the lack of guidance from MS this is an easy route to take for building arcade style games, as we can write in VB/C# rather than Javascript.