Archive for December, 2009

Spritesheets galore!

Friday, December 18th, 2009

Just saw this post over at GameDev.net with a lot of links to spritesheets for use in YOUR game! :)

Here's a sample from the game 1945

SpriteSheet from the game 1945

SpriteSheet from the game 1945

BasicStarter – something to get you up and running with XNA :)

Thursday, December 17th, 2009

basicstarterscreendumpBased on the input I received from my talk at Aalborg .Net User Group yesterday, I cleaned & commented my code and created a little XNA 3.1 Windows project called BasicStarter to download.

It is a simple start-out class for use in games for beginning XNA coders, has basic keyboard movement in four directions, fullscreen setup, black background.
It is possible to pause the game with "P"
It is possible to exit the game with "Esc"
The project also shows how a class called GameSprite which subclasses DrawableGameComponent is used to store image, position and speed of an object in a game.

Here is the class diagram. I like to get the gist of other people’s code this way Smiley

basicstarterclassdiagram

Some notable pieces of code for the beginner are:

How to get a direction from multiple keypresses
//create a variable to hold which direction to move
Vector2 movement = Vector2.Zero;

//alter the direction according to the keys pressed:
if (keyState.IsKeyDown(Keys.Down)) { movement += Directions.Down; }
if (keyState.IsKeyDown(Keys.Up)) { movement += Directions.Up; }
if (keyState.IsKeyDown(Keys.Left)) { movement += Directions.Left; }
if (keyState.IsKeyDown(Keys.Right)) { movement += Directions.Right; }

//use the combined movement from the keys
//to update the position of the XNA logo
//we multiply by gamespeed to get a reasonable speed onscreen
xnaLogo.Velocity = movement * gameSpeed;
Hope you like it - and send feedback if you can think of improvements :)

XNA talk at AANUG

Wednesday, December 16th, 2009

xnacrashcourse_firstslideJust came home from Aalborg .Net User Group (AANUG) where I had the pleasure of introducing around 20 coders to XNA. We talked our way through a little quick and dirty "Let's make a PNG move across the screen using the keyboard" to

  • Proper methods of subclassing DrawableGameComponent.
  • Using ElapsedGameTime to make animation smooth
  • Storing services in Game.Services so components can communicate
  • Etc.

All in all a fun evening with a keen crowd. Thanks to the XNA coders present who supplemented my presentation where I lacked knowledge (XBOX360 specifics and the Indie concept).

The PowerPoint is in danish - so no need to download it if you don't speak that language 😉

Xna præsentation

Silverlight experimental edition out :)

Friday, December 4th, 2009

Jesper Niedermann has ported Klima Konflikt to a SilverLight edition for web using the SilverSprite engine.

Klima Konflikt in a browser - SilverSprite style

Klima Konflikt in a browser - SilverSprite style

It's really cool that it is possible to create a game that will run in both a browser, on an XBOX360, a PC and a Zune. Of course with modifications, etc. but stil...

(And yes - I know that's been possible with Java for years using Applets ;-))

Check it out : )