Monday, March 15, 2010

Labyrinth Sample for Windows Phone

When I finally got my hands on the Windows Phone developer tools the first thing I wanted to do was to see how well Silverlight on the phone would work for making 2D games, so I decided to make a Labyrinth style game.

The setup is fairly straightforward- I’m using the same Box2D physics engine & Silverlight adapters that are included in the behaviors library I sent out in November. Basically the physics engine is running on the root of each level and the accelerometer from the Windows Phone device is hooked up to control the gravity of the physics engine. When the game is running in the emulator rather than a real device I simulate an accelerometer by dragging the mouse.

The basic application took about half a day to get running and another full day of playing around creating random levels (I tried to make it somewhat non-traditional). After that it was just polish and lots of play-testing (of course!).

The game uses the standard Windows Phone styling and navigation model to navigate between levels. Isolated storage is used to store how long it took to complete a level.

image

Standard Labyrinth-style level- everything is vector graphics & controls except for the wood textures. Uses the hardware accelerated drop-shadow effect for depth on the walls and the ball.

image

I was having a real good time playing around with alternate level ideas- this one is probably my favorite. Basically when the ball hits a flipper, the flipper activates and knocks the ball away. It’s a pretty tough level :)

image

This one is a bunch of magnets that push the ball away from them. It’s a pretty fun level to play as well.

image

Source code: Madness.zip

7 Comments:

Blogger Jobi Joy said...

Is there any reason why I am getting this error in compiling. Any mismatch in the interactivity.dll??

Error 2 The base class or interface of 'System.Windows.Interactivity.AttachableCollection' could not be resolved or is invalid c:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries\System.Windows.Interactivity.dll Madness

12:24 PM  
Blogger Bob @ Barkz said...

that blows me away

2:51 PM  
Anonymous Anonymous said...

This is awesome ... thanks!

5:24 PM  
Blogger smnbss said...

the solution is missing the Madness project...

4:43 AM  
Anonymous Brian (Hilltop) said...

Seems like from my experience the ref to System.Windows.Interactivity.dll does not pick up in one of the projects (and yet does in the others).
Just delete that ref and re-establish manually. Should be in C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Windows Phone\v7.0\Libraries or similar...

8:44 PM  
Blogger smnbss said...

To fix the problem with System.Windows.Interactivity.dll on Vista and Windows7, right click the dll and unlock it. It happen when you import dlls or exe files over the network

2:30 AM  
Blogger smartyP said...

any chance you can record a screencast sometime on using Box2D in Silverlight? I find that integration to be pretty awesome, but having a hard time finding much resources on it..

3:27 PM  

Post a Comment

<< Home