Library tutorials & articles

Game development using Silverlight 2

Introduction

VSJ This article was originally published in VSJ magazine. If you're a professional software developer based in the UK, you can claim a free annual subscription to VSJ.

Rich Internet Application (RIA) development has, until recently, largely been the preserve of the Adobe Flash/Flex or Ajax developer. So if you were a specialist in .NET development, moving into this arena involved you learning a completely new toolset and language, which in all probability meant that you didn’t bother; after all, there’s plenty of work for a good .NET developer to get their teeth into as it is.

The introduction of Silverlight 2, though, changes this position considerably. Silverlight 2 brings RIA development to the .NET developer, enabling you to leverage your existing skills and experience. Thus you can now create a RIA using C# or Visual Basic, whilst working with a class library and technologies that you’re already familiar with. All in all, this means that RIA development is now something that you can freely participate in without having to go through a lengthy re-skilling process.

One of the more interesting sub-genres of RIA is the Web-based game, and Silverlight 2 is a very capable platform for writing these games. So in this article I want to share with you a dozen or so tips that will help you to get started writing Web-based games.

Web-based games

So what is a Web-based game?

Web-based games deploy in the browser, requiring little or no client installation; they often have rudimentary graphics, tinny soundtracks and simplistic game play – expect no Far Cry or World of WarCraft here – but they are nevertheless often highly addictive. Their main appeal is the sense of immediacy about them that enables you to get into the game and start enjoying yourself straight away, without waiting for long installations to complete, which means that you can find yourself wasting an hour or two without realising it. They appear all over the Web (check out Free Video Games Online or MiniClip for some examples), and in keeping with the modern Web 2.0 philosophy, links to good games spread quickly via email or IM. Consequently, this phenomenon has not been lost on marketing departments the world over, who have realised that placing a (typically) Flash-based advertorial game on the Web can keep their organisation’s logo or product firmly embedded in the minds of users, driving increased traffic to their Web site.

When all is said and done, though, the key to a successful Web-based game is that it installs quickly and is fun to play. So without further ado let’s dive in and look at the first tip: managing the installation experience.

Comments

  1. 26 Feb 2009 at 02:55
    Best Adobe Flex Developer and Flash Programmer 1. Please visit www.busycode.com or www.flexdeveloper.com.cn 2. Low cost high quality. 3. Best Adobe Flex outsourcing service provider. 4. More than 60 full time in-house Flex developers. 5. Our company Busycode Inc. was registered in San Francisco, Beijing and Nanning. 6. Our skill set is "Adobe Flex/AIR/Flash + .NET/Java/PHP + SQL Database". 7. Our keywords are Flex developer, Flex coder, Flex programmer, Flex expert, Flex engineer, Flex specialist and Flex outsourcing service provider.
  2. 06 Dec 2008 at 22:03
    Regarding game loop, you can now use event, which fires once every frame CompositionTarget.Rendering += new EventHandler(OnRendering); You can control max frame rate: Application.Current.Host.Settings.MaxFrameRate = 25;
  3. 06 Dec 2008 at 21:57
    Nice article! My suggestion is use native to Silverlight coordinate system - clockwise, with 0 degrees at top. In MathHelper, that is double radians = (angle - 90) * (Math.PI/180.0); and return Math.Atan2(DX, -DY) * (180.0/Math.PI);

Leave a comment

Sign in or Join us (it's free).

Dave Wheeler Dave Wheeler is a freelance instructor and consultant who specialises in .NET application development. He’s a moderator on Microsoft’s ASP.NET and Silverlight forums and is a regular speaker at Dev...

Related podcasts

  • LineRider - Porting a Flash Game to Silverlight 2

    In this episode, Scott talks to Rick Barraza, an Experience Architect from Cynergy with a background in Flash, and Bryan Perfetto, a Developer from Inxile writing his first Silverlight application. They chat about how and why they ported the popular Flash Game LineRider.com to Silverlight 2.

Events coming up

  • Dec 18

    Louisville .NET Meetup - December Meetup

    Louisville, United States

    We will meet on Thursday December 17th @ Quilogy. They are located at 10350 Ormsby Park Place. Doors will open at 6:30. This month we will feature a speaker meeting. The topic being: Introduction to WPF[B-)] Abstract: Windows Presentation Foundation has been positioned as the platform of choice for Windows Client development.

We'd love to hear what you think! Submit ideas or give us feedback