Ioannis Panagopoulos blog

Tutorials on HTML5, Javascript, WinRT and .NET

XNA and WP7–Simple Demos to get you started!

by Ioannis Panagopoulos

Below you can find a series of simple demos that can give you a nice insight on the XNA’s power for WP7. All of them are original. Feel free to use them in your code as you wish. There is also a PowerPoint presentation about those demos but unfortunately it is only in Greek. So let the games begin!

 

The basics

Initializes the game and draws a simple image on the display

Sprite rotation and movement, Frame rate calculation, writing strings on the display,

Same as Demo2 but now Frame Rate calculator and bouncing sprite are implemented as game components leading to a more reusable and readable code. Now we can add more bouncing balls in an instant! Parameters are passed to game components through the use of game services

Multi-touch. Understanding where are the user’s fingers and what they do. A line is drawn and follows each finger that touches the display. The information is passed through game services to the components.

Gestures. Extending the previous demo to accelerate the ball through flicking of the display.

Accelerometer. Using the device’s accelerometer to find out device orientation and calculate g.

Saving state, using the windows phone input,sending SMS and taking snapshots from the phone’s camera from within your game!

Basic 3D drawing with axis and a pyramid with different colors.

Loading a model from a 3D modeling tool. Moving the camera with gestures.

Textures and lighting in the previous models!

 

And some more complete demos.

A simple spaceship constantly shoots laser beams to its enemy.

Creates a terrain based on a heightmap provided by a color coded bmp. You can navigate in the terrain using the drawn HUD and its implementation!

Using the Farseer physics engine to make the world bounce. Demo is the one from this linkthat I totally recommend for you to read.

 

Custom collision detection

If you want to know when two objects of your 2D world collide check out the following link.

Also check this series for a more gentle introduction to XNA.

 

The complete presentation for all of the above (in Greek)

Part of it will be presented in Hackathon 2012 for WP7.5

 

An of course the App Hub main game development page.

Finally read about the exciting new feature of integrating Silverlight and XNA in a single application .

blog comments powered by Disqus
hire me