Creating a new game using Xen

Select your platform (Windows/Windows Phone 7, Xbox 360, or Web) and follow the instructions below to get up and running with your first Xen game.

Windows, Windows Phone 7, and Xbox 360

  1. Create a standard XNA Game Project (for your appropriate device) in Visual Studio.
  2. Add the Xen references by opening your Project and righting-clicking References -> Add Reference. (locate the Xen assemblies that you downloaded or built)
  3. Delete everything in Game1.cs and add the following instead:

using Microsoft.Xna.Framework;
using XenGameBase;

namespace MyXenGame
{
    public class Game : GameBase
    {
    }
}

Web

  1. Create a new Silverlight Project in Visual Studio.
  2. Add the Silversprite references.
  3. Edit your MainPage.xaml file to look something like this:

<UserControl x:Class="Demo_MouseBasics_Silverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:game="clr-namespace:MyXenGame">
    <Grid x:Name="LayoutRoot">
        <Canvas>
            <game:MyXenGame x:Name="game"/>
        </Canvas>
    </Grid>
</UserControl>

Next, add a new Game class to the project:

using Microsoft.Xna.Framework;
using XenGameBase;

namespace MyXenGame
{
    public class Game : GameBase
    {
    }
}

Congratulations! You've just successfully created your first Xen game. Build and run it to make sure everything works (you should see a cornflower blue background). Check out these other topics for quick ways you can start building your game:
Drawing Primitives

Last edited Feb 10, 2011 at 7:38 AM by robzhu, version 7

Comments

backwardsByte Jan 27, 2013 at 11:52 PM 
I had to refactor Game1 inside Program.cs to Game, no biggie. Works like a charm.