Home .NET Example of developing simple casual games for Windows 8

Example of developing simple casual games for Windows 8

by admin

Casual games

Example of developing simple casual games for Windows 8
To participate in the Windows 8 app contest, I decided to choose casual games as my app theme.Firstly, it is always interesting to develop a small game myself, and secondly, there was simply no time to develop something big. In this article, I want to talk briefly about my first experience developing for Windows 8 and share my impressions.

Game ideas

I had a total of 5 games in mind. I decided to write them in C# + XAML since I was already familiar with Silverlight (MCP by SL4) and Windows Phone 7 development. So, here is what I decided to implement :

  • Flip-flop game (I had such a game written for WP7)
  • A game for a 2 year old daughter in which you have to guess the shape or color of a shape
  • A game in which you have to pick a "key" for a lock pick by eye
  • Game in which you need to look at the labyrinth to estimate how much thread is needed to pass it
  • A game where you have to quickly put the ball in the right hole

Game ideas were partly taken from something I’d seen somewhere (I played a flip-flop game in high school computer science class), or made up in between.

A little about implementation

In all the games I used Grid to place the elements. For those games where DragDrop was needed, I used Canvas. To separate the elements visually by color, I applied the rainbow rule, which is a reliable and proven option. Separately, all the elements that could be declared in XAML I declared there, but in order to gain control over them, for example to hide or show, I added these elements to the collection, and then in the loop to process them. Towards the end of the development of the last game I realized that I had to use animation for any action on objects. Here, by the way, there was a surprise when porting code from WP7:in Windows 8 there is an animation that is called dependent and must be explicitly declared as such. This type includes, for example, the UIElement size animation. Another good rule is that the game starts to look much more attractive if you adjust the gradients and transparency of visual elements. Here another surprise awaited me: for some reason among the available brushes I couldn’t find a place for RadialGradientBrush. That’s why my balloons turned out to be flat. I have not localized the application to English yet, I decided to do it in the next update. All in all, developing for Windows 8 was quite pleasant and Visual Studio 2012 behaved well. I stored the project in a cloud TFS on tfspreview.com

Simultaneous development for win8 and wp7

Porting a game from WP7 to Windows 8 and back is pretty easy if you don’t use local storage on your phone on Linq2sql. Windows 8 has gone even more towards content consumption, so creating an application with a local database on SQL CE is no longer possible. On the other hand, Windows 8 has tighter integration with the Microsoft cloud, which allows, for example, to transfer settings between devices in a transparent way.
The most obvious problem with porting apps is the issue of screen size mismatch. Everything is very compact on the phone, and Windows 8 leaves too much free space. On the other hand, XAML is quite flexible in allowing you to customize the interface to work in different resolutions.

Windows Store

The timeframe for certifying apps before the release of Windows 8 has, of course, increased. My first app was validated in 7 days (as it says in the dashboard), the fifth was validated in 11 days. The apps are published to the store almost immediately after checking, unlike WP7 apps, which are not available until 24 hours after certification. By the way, the WP7 application was checked for 14 days.

Links to applications

Here’s a list of apps I’ve developed. They are all free.
SimSimGame (flip-flop).
apps.microsoft.com/webpdp/ru-RU/app/simsimgame/4d404c1d-b360-45eb-bd3b-d54342835b6e
2. Match4Kids (pick the right shape)
Windows 8: apps.microsoft.com/webpdp/ru-RU/app/match4kids/ea9772aa-33cf-4144-9aa6-5c08feddc4cc
WP7: www.windowsphone.com/ru-ru/store/app/match4kids/10ef27b9-3fe1-493d-82ed-7f89fc4bbd84
3. Keyhole (pick a key for the lock)
apps.microsoft.com/webpdp/ru-RU/app/keyhole/7d45ed87-3618-4216-93a5-18b7e9c1aa2b
4. Thread4Maze (thread for labyrinth)
apps.microsoft.com/webpdp/ru-RU/app/thread4maze/b5ba4f9a-0a38-4fd0-9b02-486cb9c5f545
5. Balls2Holes (moving balls at speed)
apps.microsoft.com/webpdp/ru-RU/app/balls2holes/76c8f7e0-cc9f-4e87-b06d-a9f88e72c930
I will gladly listen to constructive criticism and try to refine the apps to make them better.

You may also like