Thursday, September 22, 2005

Minesweeper in XAML:Project Files & Source Code

I recently created a simple Minesweeper implementation using Acrylic and Sparkle (Microsoft Expression codename Acrylic Graphic Designer and Sparkle Interactive Designer. or whatever.), the graphics were done by Aaron Jasinski, exported then styled in Avalon using Sparkle.

There are a couple things that make this application interesting.

First, I tried quite hard to make this a 'clean' application. I can be quite pedantic when it comes to code design. I'm hoping that this app can help some people understand Avalon and more importantly XAML. The application follows a clean Model/View split, if there are doubters about Avalon's ability to style an application, I urge you to tear into the code. The game logic has *no* UI knowledge and the UI code is 95% XAML. Extremely limited C# and I'm angry that I had to use as much as I did.

Second, the UI for the application was made by a graphic designer, in a graphic design tool with absolutely no thought to implementation. With very minimal tweaks to the original Acrylic drawing I was able to export all the components for use in Sparkle. Restyling the application is as easy as updating the drawings in Acrylic then re-exporting. If you take a look at the project, Drawings.xaml is auto-generated by Acrylic. It's incredibly smooth.

Finally, the application was written on a red-eye flight, flying from Seattle to Boston between 11PM and 5AM (I don't really sleep on planes, and what's a better way to pass the time than to make fun games?). This is by no means a finished app, but it's definitely not a mock-up either. Application development time measured in hours is cool. Real cool. It's to the point where I'm asking people for app ideas mocked up in Acrylic that can be implemented when I'm bored.

Many thanks to Aaron for the awesome graphics. If you're wondering where the animations are, Manuel promised to do them. Maybe this will remind him :)

And to whet your appetite, opened in Sparkle:

And in Acrylic:

Upcoming- XAML tips & tricks. If you have questions, ask away.

5 Comments:

Blogger Avalonic said...

When I try to build your project, it throws an IOException on startup, saying "Cannot locate the resource 'window1.baml'".
I have the suspicion this has something to do with UI culture settings because I'm not running an english OS.

12:46 PM  
Blogger Avalonic said...

it's working after I removed the UICulture tag in the csproj file. Looks like something is still messy in Avalon with cultures.
cheers!

7:54 AM  
Blogger pete blois said...

Very good to know, I was just investigating this. The UICulture tag has been required in previous Avalon versions, I guess not anymore!

7:29 PM  
Blogger Martin said...

Hi, could you add an RSS feed? I'd appreciate it. Keep the Avalon content commin'!

Thanks!

3:40 AM  
Blogger Avalonic said...

It is like this - the VS template automatically sets culture to en-US, so all ressources are compiled to the satellite assembly for this culture.
When you run or compile it on a different OS, it looks for the appropriate culture (de-DE in my case) or at the neutral ressource - none of which is there.
By searching the SDK help, I found out you can specify a ressource for a specific culture to use for neutral culture.
It looks like this:
[assembly: NeutralResourcesLanguageAttribute("en-US",
UltimateResourceFallbackLocation.Satellite)]

5:32 AM  

Post a Comment

<< Home