XNA UK User Group

A helping hand for bedroom coders throughout the land.
in

This Blog

Syndication

Twitters

RandomChaos

  • Stowaways - A ZuneRay Game

    http://www.youtube.com/v/aAl-8n5TmAo <p><a href="http://www.youtube.com/v/aAl-8n5TmAo">http://www.youtube.com/v/aAl-8n5TmAo</a></p>

    So, as you have seen I have written a raycasting engine for the Zune in XNA. Using this engine I have started to create a game called stowaways, here is the story (I kind of skip it in the clip)

    "STOWAWAYS

    During a standard patrol of sector 7
    the starship Dakatau locked onto a distress call
    located near a little visited planet, Oren-12, the
    twelfth moon of Oren.

    The crew found a yacht listing in a deteriorating orbit
    off the planet. Scans of the Ahubu came back negative
    for life but a boarding party was sent to the yacht
    none the less.

    After an hours search, no one was found on board,
    dead or alive.

    Three months into the return journey and the crew
    of the Dakatau have started to go missing......

    After a week, you are the only one left......"

     I hope to start blogging the mechanics of this soon, so if you are interested watch this space :)

    C&C Welcome as ever, and please, remember I am a programmer not an artist!!

  • Microsoft Visual Studio 2010 Professional Upgrade Special Offer

    Microsoft Visual Studio 2010 Professional will launch on April 12 but you can beat the rush and secure your copy today by pre-ordering at the affordable estimated retail price of £484.99.  If you use a previous version of Visual Studio or any other development tool then you are eligible for this upgrade. Along with all the great new features in Visual Studio 2010 (see www.microsoft.com/visualstudio) Visual Studio 2010 Professional includes a 12-month MSDN Essentials subscription which gives you access to core Microsoft platforms: Windows 7 Ultimate, Windows Server 2008 R2 Enterprise, and Microsoft SQL Server 2008 R2 Datacenter.  So visit http://www.microsoft.com/visualstudio/en-gb/pre-order-visual-studio-2010 to check out all the new features and sign up for this great offer.

     

  • MVP 2010 Summit

    Well, what a great week I had a the summit, as ever, can’t tell you much about it due to our NDA’s but here are some pics from my time there, I have also pinched some pics from other MVP’s (well Benjamin’s pics :P)

    2010-02-16 17.39.12

    Bellevue was really nice, quite, but nice.

    2010-02-16 17.39.23

    My room mate Vicente Cartas Espinel, was great to meet you Vicente, you were a great roomie :)

    2010-02-17 02.23.40

    Andy “Z_Man” Dunn and Michael Cummings, just off to the left is Catalin Zima. It was so cool to meet so many XNA community legends, I was quite awestruck I think.. o.O

    2010-02-17 02.23.49

    Phil Bourke and Vicente in deep conversation, Benjamin Nitschke is to the right.

    2010-02-17 04.30.33

    MVP’s, beer and XNA talk, a great combination! (well till the morning I found..)

    2010-02-17 06.25.44

    No idea what Andy was conveying here, I may have had one too many by this time..

    2010-02-17 19.36.51

    Onto the serious stuff, day 1 of XNA bits..

    2010-02-18 03.50.36

    Some RockBand madness.

    2010-02-19 00.56.52

    Got to meet the XNA Team too, I am truly awestruck now…!

    2010-02-19 01.45.08

    Back to the hotel (this was the view from our window), before off out again.

    Next set of pictures are Benjamin’s, can you tell I have had a drink?

    BenjaminsPics1

    I may have had a pint or so…

    BenjaminsPics5

    Yep, had a few we did….

    BenjaminsPics3

    Packing up our stuff, last day of XNA stuff…sad day..

    I then got to wander around Seattle before I went home, here are a few pics I took..

    DSC00016 DSC00021 DSC00026

    All in all I think we all had a great time, I would like to say thanks to the MVP program for looking after us, the XNA Team for all there effort, both on the day’s and the work they must have had to do in the build up. And also to Andy Dunn, for letting me crash at his house for a couple of nights. Thanks all :D

  • XNA and Windows 7 Multi-touch

    I am pretty sure, that like me you are more than capable of scanning the web for snippets of info on how to do this, well I thought, to save you the time and effort I’ll put up a simple how-to here.

    As ever I am standing on the shoulder of giants, the first thing I do to get multi-touch into my XNA project is to use a regular windows form to render to. I dare say there it a much better way to do this with WPF, which I am sure I’ll have a look at when I have time, but for now,  I am using the good old 2.0 Windows Form.  Now for this I have used a great post by another XNA MVP Pedro Guida aka “Ultrahead” showing how to get XNA to render to a panel control. I can’t for the life of me find his original post, it may have even been on The Code Project and also used the MS Multitouch code samples.

    The spawn of these two resources has  given me my own Panel control that XNA can render to AND the Windows 7 Multi-touch API can be hooked up to.

    So, how does all this hang together first off we open up a new XNA Windows Project, then Add a Windows Form to the project, we then need to create our own Panel object so that it can interact with multi-touch.

    The code for the new Panel class is 99% taken from the MS Multitouch samples and it involves hooking into the WndProc method on the control.

    XNAWindowsMTPanel

        public class XNAWindowsMTPanel : Panel
        {
            ///////////////////////////////////////////////////////////////////////
            // Protected members, for derived classes.

            // Touch event handlers
            public event EventHandler<WMTouchEventArgs> Touchdown;   // touch down event handler
            public event EventHandler<WMTouchEventArgs> Touchup;     // touch up event handler
            public event EventHandler<WMTouchEventArgs> TouchMove;   // touch move event handler

            // EventArgs passed to Touch handlers
            public class WMTouchEventArgs : System.EventArgs
            {
                // Private data members
                private int x;                  // touch x client coordinate in pixels
                private int y;                  // touch y client coordinate in pixels
                private int id;                 // contact ID
                private int mask;               // mask which fields in the structure are valid
                private int flags;              // flags
                private int time;               // touch event time
                private int contactX;           // x size of the contact area in pixels
                private int contactY;           // y size of the contact area in pixels

                // Access to data members
                public int LocationX
                {
                    get { return x; }
                    set { x = value; }
                }
                public int LocationY
                {
                    get { return y; }
                    set { y = value; }
                }
                public int Id
                {
                    get { return id; }
                    set { id = value; }
                }
                public int Flags
                {
                    get { return flags; }
                    set { flags = value; }
                }
                public int Mask
                {
                    get { return mask; }
                    set { mask = value; }
                }
                public int Time
                {
                    get { return time; }
                    set { time = value; }
                }
                public int ContactX
                {
                    get { return contactX; }
                    set { contactX = value; }
                }
                public int ContactY
                {
                    get { return contactY; }
                    set { contactY = value; }
                }
                public bool IsPrimaryContact
                {
                    get { return (flags & TOUCHEVENTF_PRIMARY) != 0; }
                }

                // Constructor
                public WMTouchEventArgs()
                {
                }
            }

            ///////////////////////////////////////////////////////////////////////
            // Private class definitions, structures, attributes and native fn's
            //Exercise1-Task2-Step2

            // Touch event window message constants [winuser.h]
            private const int WM_TOUCHMOVE = 0x0240;
            private const int WM_TOUCHDOWN = 0x0241;
            private const int WM_TOUCHUP = 0x0242;

            private const int WM_MOUSEMOVE = 0x0200;
            private const int WM_LBUTTONDOWN = 0x0202;
            private const int WM_LBUTTONUP = 0x0208;
            private const int WM_MBUTTONDBLCLK = 0x0209;

            // Touch event flags ((TOUCHINPUT.dwFlags) [winuser.h]
            private const int TOUCHEVENTF_MOVE = 0x0001;
            private const int TOUCHEVENTF_DOWN = 0x0002;
            private const int TOUCHEVENTF_UP = 0x0004;
            private const int TOUCHEVENTF_INRANGE = 0x0008;
            private const int TOUCHEVENTF_PRIMARY = 0x0010;
            private const int TOUCHEVENTF_NOCOALESCE = 0x0020;
            private const int TOUCHEVENTF_PEN = 0x0040;

            // Touch input mask values (TOUCHINPUT.dwMask) [winuser.h]
            private const int TOUCHINPUTMASKF_TIMEFROMSYSTEM = 0x0001; // the dwTime field contains a system generated value
            private const int TOUCHINPUTMASKF_EXTRAINFO = 0x0002; // the dwExtraInfo field is valid
            private const int TOUCHINPUTMASKF_CONTACTAREA = 0x0004; // the cxContact and cyContact fields are valid

            // Touch API defined structures [winuser.h]
            //Exercise1-Task2-Step4
            [StructLayout(LayoutKind.Sequential)]
            private struct TOUCHINPUT
            {
                public int x;
                public int y;
                public System.IntPtr hSource;
                public int dwID;
                public int dwFlags;
                public int dwMask;
                public int dwTime;
                public System.IntPtr dwExtraInfo;
                public int cxContact;
                public int cyContact;
            }

            [StructLayout(LayoutKind.Sequential)]
            private struct POINTS
            {
                public short x;
                public short y;
            }

            // Currently touch/multitouch access is done through unmanaged code
            // We must p/invoke into user32 [winuser.h]
            //Exercise1-Task2-Step3
            [DllImport("user32")]
            [return: MarshalAs(UnmanagedType.Bool)]
            private static extern bool RegisterTouchWindow(System.IntPtr hWnd, ulong ulFlags);

            [DllImport("user32")]
            [return: MarshalAs(UnmanagedType.Bool)]
            private static extern bool GetTouchInputInfo(System.IntPtr hTouchInput, int cInputs, [In, Out] TOUCHINPUT[] pInputs, int cbSize);

            [DllImport("user32")]
            [return: MarshalAs(UnmanagedType.Bool)]
            private static extern void CloseTouchInputHandle(System.IntPtr lParam);

            // Attributes
            private int touchInputSize;        // size of TOUCHINPUT structure

            [SecurityPermission(SecurityAction.Demand)]
            public XNAWindowsMTPanel()
            {
                Dock = DockStyle.Fill;
                // GetTouchInputInfo need to be
                // passed the size of the structure it will be filling
                // we get the sizes upfront so they can be used later.
                touchInputSize = Marshal.SizeOf(new TOUCHINPUT());
            }

            protected override CreateParams CreateParams
            {
                get
                {
                    CreateParams createParams = base.CreateParams;
                    createParams.ExStyle |= 0x00000020; // WS_EX_TRANSPARENT
                    return createParams;
                }
            }

            protected override void CreateHandle()
            {
                base.CreateHandle();
                ulong ulFlags = 0;
                RegisterTouchWindow(this.Handle, ulFlags);
            }

            ///////////////////////////////////////////////////////////////////////
            // Private methods

            // Window procedure. Receives WM_ messages.
            // Translates WM_TOUCH window messages to touch events.
            // Normally, touch events are sufficient for a derived class,
            // but the window procedure can be overriden, if needed.
            // in:
            //      m       message
            [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
            protected override void WndProc(ref Message m)
            {
                // Decode and handle WM_TOUCH* message.
                bool handled;
                switch (m.Msg)
                {
                    case WM_TOUCHDOWN:
                    case WM_TOUCHMOVE:
                    case WM_TOUCHUP:
                        handled = DecodeTouch(ref m);
                        break;
                    default:
                        handled = false;
                        break;
                }

                // Call parent WndProc for default message processing.
                base.WndProc(ref m);

                if (handled)
                {
                    // Acknowledge event if handled.
                    try
                    {
                        m.Result = new System.IntPtr(1);
                    }
                    catch (Exception exception)
                    {
                        Debug.Print("ERROR: Could not allocate result ptr");
                        Debug.Print(exception.ToString());
                    }
                }
            }

            // Extracts lower 16-bit word from an 32-bit int.
            // in:
            //      number      int
            // returns:
            //      lower word
            private static int LoWord(int number)
            {
                return number & 0xffff;
            }

            // Decodes and handles WM_TOUCH* messages.
            // Unpacks message arguments and invokes appropriate touch events.
            // in:
            //      m           window message
            // returns:
            //      flag whether the message has been handled
            private bool DecodeTouch(ref Message m)
            {
                // More than one touchinput may be associated with a touch message,
                // so an array is needed to get all event information.
                int inputCount = LoWord(m.WParam.ToInt32()); // Number of touch inputs, actual per-contact messages

                TOUCHINPUT[] inputs; // Array of TOUCHINPUT structures
                try
                {
                    inputs = new TOUCHINPUT[inputCount]; // Allocate the storage for the parameters of the per-contact messages
                }
                catch (Exception exception)
                {
                    Debug.Print("ERROR: Could not allocate inputs array");
                    Debug.Print(exception.ToString());
                    return false;
                }

                // Unpack message parameters into the array of TOUCHINPUT structures, each
                // representing a message for one single contact.
                //Exercise2-Task1-Step3
                if (!GetTouchInputInfo(m.LParam, inputCount, inputs, touchInputSize))
                {
                    // Get touch info failed.
                    return false;
                }

                // For each contact, dispatch the message to the appropriate message
                // handler.
                // Note that for WM_TOUCHDOWN you can get down & move notifications
                // and for WM_TOUCHUP you can get up & move notifications
                // WM_TOUCHMOVE will only contain move notifications
                // and up & down notifications will never come in the same message
                bool handled = false; // // Flag, is message handled
                //Exercise2-Task1-Step4
                for (int i = 0; i < inputCount; i++)
                {
                    TOUCHINPUT ti = inputs[i];

                    // Assign a handler to this message.
                    EventHandler<WMTouchEventArgs> handler = null;     // Touch event handler
                    if ((ti.dwFlags & TOUCHEVENTF_DOWN) != 0)
                    {
                        handler = Touchdown;
                    }
                    else if ((ti.dwFlags & TOUCHEVENTF_UP) != 0)
                    {
                        handler = Touchup;
                    }
                    else if ((ti.dwFlags & TOUCHEVENTF_MOVE) != 0)
                    {
                        handler = TouchMove;
                    }

                    // Convert message parameters into touch event arguments and handle the event.
                    if (handler != null)
                    {
                        // Convert the raw touchinput message into a touchevent.
                        WMTouchEventArgs te; // Touch event arguments

                        try
                        {
                            te = new WMTouchEventArgs();
                        }
                        catch (Exception excep)
                        {
                            Debug.Print("Could not allocate WMTouchEventArgs");
                            Debug.Print(excep.ToString());
                            continue;
                        }

                        // TOUCHINFO point coordinates and contact size is in 1/100 of a pixel; convert it to pixels.
                        // Also convert screen to client coordinates.
                        te.ContactY = ti.cyContact / 100;
                        te.ContactX = ti.cxContact / 100;
                        te.Id = ti.dwID;
                        {
                            Point pt = PointToClient(new Point(ti.x / 100, ti.y / 100));
                            te.LocationX = pt.X;
                            te.LocationY = pt.Y;
                        }
                        te.Time = ti.dwTime;
                        te.Mask = ti.dwMask;
                        te.Flags = ti.dwFlags;

                        // Invoke the event handler.
                        handler(this, te);

                        // Mark this event as handled.
                        handled = true;
                    }
                }

                CloseTouchInputHandle(m.LParam);

                return handled;
            }
        }

    So now we have a control we can use to get MT input for, we now need to hook this control up to our form and in turn to our XNA Game class. In the form we need to give our Game class access to the handle it is going to render to. To do this we define XNAWindowsMTPanel object, create a Property on the form so that it can be accessed and then instantiate the XNAWindowsMTPanel object. This leaves our form source code looking like this:

        public partial class frmMain : Form
        {
            public XNAWindowsMTPanel panel1;

            public IntPtr DisplayHandle
            {
                get
                {
                    return this.panel1.IsHandleCreated ?
                           this.panel1.Handle : IntPtr.Zero;
                }
            }

            public frmMain(Game1 game)
            {
                InitializeComponent();

                panel1 = new XNAWindowsMTPanel();

                

                this.Controls.Add(panel1);
            }
            
        }

    Now in our game class we need to set up the Windows form to be the form we will be rendering to, we create a From object, in the constructor, instantiate, bind to the forms HandleDestroyed event so when the form closes we can tidy up and then show the form. We also need to be able to ‘hide’ our XNA game window to so to do this we need to bind to the XNA game windows Shown event and then hide the window. To help us do this we will need to reference System.Windows.Forms in our Game1 class and to stop any name space conflicts we will alias it with ‘SysWinForms’. We also need to set our view port so that it matches the area we are rendering to and this also needs to be done if the form is resized.

    The top of our Game1.cs file now looks like this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.GamerServices;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using Microsoft.Xna.Framework.Media;
    using Microsoft.Xna.Framework.Net;
    using Microsoft.Xna.Framework.Storage;

    using SysWinForms = System.Windows.Forms;

    namespace GenericXNAMultiTouch
    {
        /// <summary>
        /// This is the main type for your game
        /// </summary>
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;

            frmMain frmMain;

            

            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";

                SysWinForms.Form gameWindow = (SysWinForms.Form)SysWinForms.Form.FromHandle(this.Window.Handle);
                gameWindow.Shown += new EventHandler(gameWindow_Shown);

                frmMain = new frmMain(this);
                frmMain.HandleDestroyed += new EventHandler(frmMain_HandleDestroyed);
                frmMain.Resize += new EventHandler(frmMain_Resize);
                frmMain.Show();

                graphics.PreferredBackBufferHeight = frmMain.panel1.Height;
                graphics.PreferredBackBufferWidth = frmMain.panel1.Width;
            }

            void frmMain_Resize(object sender, EventArgs e)
            {
                if (GraphicsDevice.Viewport.Width != frmMain.panel1.Width || GraphicsDevice.Viewport.Height != frmMain.panel1.Height)
                {
                    GraphicsDevice.Viewport = new Viewport
                    {
                        X = 0,
                        Y = 0,
                        Height = frmMain.panel1.Height,
                        Width = frmMain.panel1.Width,
                        MaxDepth = GraphicsDevice.Viewport.MaxDepth,
                        MinDepth = GraphicsDevice.Viewport.MinDepth,
                    };
                }
            }

            void frmMain_HandleDestroyed(object sender, EventArgs e)
            {
                Exit();
            }

            void gameWindow_Shown(object sender, EventArgs e)
            {
                ((SysWinForms.Form)sender).Hide();
            }

    Running this now will just give us a blank Windows Form, we need to now tell our Game1 class to render to our XNAWindowsMTPanel and this is very simple to do, simply at the end of the Draw call do this:

                GraphicsDevice.Present(frmMain.DisplayHandle);

    You will now have your XNA code rendering on the windows form!! How cool is that!

    Now to add the MT functionality. You can see on the XNAWindowsMTPanel class that we have some events we can bind to:

            // Touch event handlers
            public event EventHandler<WMTouchEventArgs> Touchdown;   // touch down event handler
            public event EventHandler<WMTouchEventArgs> Touchup;     // touch up event handler
            public event EventHandler<WMTouchEventArgs> TouchMove;   // touch move event handler

    So we we will get some code stubs in our Game1 class then wire these up in Windows Form (again taken from the MS MT samples)

            #region Multi-Touch
            // Touch Stuff
            // Touch down event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchDownHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                
            }

            // Touch up event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchUpHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                
            }

            // Touch move event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchMoveHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                
            }
            #endregion

    And now to wire them up in the form:

            public frmMain(Game1 game)
            {
                InitializeComponent();

                panel1 = new XNAWindowsMTPanel();

                // Touch stuff
                // Setup handlers
                panel1.Touchdown += game.OnTouchDownHandler;
                panel1.Touchup += game.OnTouchUpHandler;
                panel1.TouchMove += game.OnTouchMoveHandler;

                this.Controls.Add(panel1);
            }

    So, we now have our XNA project rendering on a windows form that is also able to accept munti touch commands, so how can we demonstrate this?

    First of all we are going to create an object that we can use to store the touch events in, this will also hold some data to help us represent the touch on the screen.

        public class MTObject
        {
            public XNAWindowsMTPanel.WMTouchEventArgs Event;
            public Point[] spritePositions;
            public Color Color;
            public float Rotation = 0;
            public int Size;

            public MTObject(XNAWindowsMTPanel.WMTouchEventArgs e,int size,Color color)
            {
                Event = e;
                spritePositions = new Point[100];
                Color = color;
                Size = size;
            }        
        }

    We then create a Dictionary to store these items in, I am also going to add a Texture2D to render the touch objects and give an audio que with a SoundEffect Object. This is hoe I have defined them in the Game1 class:

            Dictionary<int, MTObject> touchList = new Dictionary<int, MTObject>();

            Texture2D sprite;
            SoundEffect touchWav;

     

     

     

     

    Now all we need to do is record when we have a touch contact, when one is removed and when one is moved. Our touch event handlers now look like this:

            #region Multi-Touch
            // Touch Stuff
            // Touch down event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchDownHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                // Is this a new touch or an old one?
                if (!touchList.Keys.Contains(e.Id))
                {
                    if (e.IsPrimaryContact)
                        touchList.Add(e.Id, new MTObject(e, 32,Color.Red));
                    else
                        touchList.Add(e.Id, new MTObject(e, 16, Color.Gold));
                }

                touchWav.Play();

            }

            // Touch up event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchUpHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                if (touchList.Keys.Contains(e.Id))
                    touchList.Remove(e.Id);
            }

            // Touch move event handler.
            // in:
            //      sender      object that has sent the event
            //      e           touch event arguments
            public void OnTouchMoveHandler(object sender, XNAWindowsMTPanel.WMTouchEventArgs e)
            {
                touchList[e.Id].Event.LocationX = e.LocationX;
                touchList[e.Id].Event.LocationY = e.LocationY;
            }
            #endregion

    I then make sure that the array of points I am using to represent the touch contacts is updated, effectively giving a string of particles after the touch contact point, giving us the following Update and Draw methods:

            /// <summary>
            /// Allows the game to run logic such as updating the world,
            /// checking for collisions, gathering input, and playing audio.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Update(GameTime gameTime)
            {
                // Allows the game to exit
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();

                foreach (int key in touchList.Keys)
                {
                    for (int s = touchList[key].spritePositions.Length - 1; s > 0; s--)
                    {
                        touchList[key].spritePositions[s] = touchList[key].spritePositions[s - 1];
                    }
                    touchList[key].spritePositions[0] = new Point(touchList[key].Event.LocationX, touchList[key].Event.LocationY);
                }

                base.Update(gameTime);
            }

            /// <summary>
            /// This is called when the game should draw itself.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Draw(GameTime gameTime)
            {
                GraphicsDevice.Clear(Color.CornflowerBlue);

                base.Draw(gameTime);

                Color alphaColor;

                spriteBatch.Begin();
                foreach (int key in touchList.Keys)
                {
                    for (int s = touchList[key].spritePositions.Length - 1; s > 0; s--)
                    {
                        touchList[key].spritePositions[s] = touchList[key].spritePositions[s - 1];
                        alphaColor = new Color(touchList[key].Color.R, touchList[key].Color.G, touchList[key].Color.B, (1 - (s / (float)touchList[key].spritePositions.Length)));
                        spriteBatch.Draw(sprite, new Rectangle(touchList[key].spritePositions[s].X, touchList[key].spritePositions[s].Y, touchList[key].Size, touchList[key].Size), new Rectangle(0, 0, sprite.Width, sprite.Height), alphaColor, touchList[key].Rotation++, new Vector2(sprite.Width / 2, sprite.Height / 2), SpriteEffects.None, 1);
                    }
                    
                    alphaColor = touchList[key].Color;
                    spriteBatch.Draw(sprite, new Rectangle(touchList[key].spritePositions[0].X, touchList[key].spritePositions[0].Y, touchList[key].Size, touchList[key].Size), new Rectangle(0, 0, sprite.Width, sprite.Height), alphaColor, touchList[key].Rotation++, new Vector2(sprite.Width / 2, sprite.Height / 2), SpriteEffects.None, 1);
                    

                }
                spriteBatch.End();

                GraphicsDevice.Present(frmMain.DisplayHandle);
            }

    http://www.youtube.com/v/6Ekgr3SqMRA <p><a href="http://www.youtube.com/v/6Ekgr3SqMRA">http://www.youtube.com/v/6Ekgr3SqMRA</a></p>  

    And that’s about it, hope you find it useful. The solution for this post can be found here. As ever C&C welcome.

  • ZuneRay

    http://www.youtube.com/v/7VANrA3noE0 <p><a href="http://www.youtube.com/v/7VANrA3noE0">http://www.youtube.com/v/7VANrA3noE0</a></p>

    So, I have this ZuneHD and have been playing about with it for abit now, so looked into what I can do with it. Turns out quite a bit after finding some great samples from the likes of Nick Gravelyn.

    So as you can see in the clip, with these samples under my belt I started writing my own Raycaster for the Zune. It is still early days yet, need to do afair bit more (just like all my other unfinished projects I hear you shout!!) and I think it will make for a nice base for creating raycasting games on the Zune.

    I don't know about you (or even if you are old enough to remember), but I loved Wolfenstine3D, so this sort of engine will enable you to make games just like that :)

    As ever C&C welcome.

  • DXTop, now with Windows7 Multi-touch and Ray Picking

    http://www.youtube.com/v/jbHyboEYe6g <p><a href="http://www.youtube.com/v/jbHyboEYe6g">http://www.youtube.com/v/jbHyboEYe6g</a></p>

    OK, have now integrated the Windows7 Multi-touch API into this odd XNA project and with that integrated Ray picking so I can now interact with the applications.

     I will start to post this stuff soon :)

    C&C Welcome...

  • Programming in C# with XNA – Object Orientated Basics

    We now have some of the basics under our belt, we can create variables, we can assign values to them and make conditional decisions on our code. We are now going to look at the Object Orientated side of Programming (OOP).

    What is OOP?

    In as simple terms as I can muster, it’s a way of structuring our data, we can take our variables and put them in an Object. “But Why?” I hear you ask… Well, it’s a great way of structuring your programs so that they resemble more obvious entities, for example, in the last post we created a number of variables, player name, score, lives etc… Rather than have a load of disbanded variables roaming about our game code we can put these variables into a single Object and we could call that object Player.

    How to define an Object

    To define an object we are going to use a ‘class’. I think a good way to think of a ‘class’ is to see it as a blueprint of your Object. If we were to create a more complex Object than a player, lest say a Vehicle then we need to think about what a Vehicle will need, so, for starters it will need an engine, a fuel tank, a navigation system to turn, accelerate and break. As a basic vehicle goes, that’s pretty much all we need. So a definition of a vehicle class could look like this:

        public class BaseVehicle
        {
            public BaseEngine Engine;
            public BaseFuelTank FuelTank;
            public BaseNavSystem NavSystem;

            public Vector3 Velocity;
            public Vector3 Acceleration;

            public BaseVehicle()
            {
                Engine = new BaseEngine();
                FuelTank = new BaseFuelTank();
                NavSystem = new BaseNavSystem();
            }
        }

    To add a new class to the project, right click on the project name (RCProgrammingTutorial) select ‘Add’ then ‘Class’ from the drop down menu.

    You can see in our class we contain other objects here, BaseEngine, BaseFuelTank and BaseNavSystem, Velocity (we need to know what direction and speed we are heading) and Acceleration. You can also see what is called a ‘constructor’ (ctor). This is used to set up our member objects so they are ready to use. You don’t have to create a constructor, but it can help if you have member objects you want initialized when you create an instance of the object.

    As I am sure you can imagine, we could take this example a long way, there are lots more things a vehicle needs, but this help show the basic layout of a class and the sort of things you need to think about when creating them. So how will our Player class look?

        public class Player
        {
            protected string playerName;
            protected int score;

            public Player(string name)
            {
                playerName = name;
                score = 0;
            }
        }

    We have defined the Player class with two members playerName and score. We have also created a constructor with a parameter of string name, this means when we create an instance of the object we can load the playerName variable at the same time. We have also defined the members as ‘protected’, I will explain this a bit more in the section Inheritance, but in essence, the protected access modifier means that only this class can see this variable. So it has restricted the ‘scope’ of this variable to this class, which means that when we create an instance of the object, we can’t access the variables, “Why would we want to do that!!” I hear you shout, well this is a form of encapsulation..

    Encapsulation

    Sometimes we don’t want to give full access to our member variables or we may want to do some extra processing when member variables are accessed or set and this can be done with ‘encapsulation’. So, how do we give the outside world access to those protected or private member variables?  With Properties or functions. Personally I prefer to use properties, but in some cases you will need to use functions to do this depending on the kind of actions you are trying to impose. How do we set up properties then, like this:

            public string PlayerName
            {
                get
                {
                    return playerName;
                }
                set
                {
                    // Code to detect if bad language has bee used
                    // ...
                    // ...

                    playerName = value;
                }
            }
            public int Score
            {
                get { return score; }
                set { score = value; }
            }

    I have created two properties, one for playerName and one for score, as you can see the layout is different but they both do the same job really, the ‘get’ section allows access to the variable and the set allows the variables content to be changed. As you can see in the set part of the PlayerName property you could have code there to make sure that the players name is not set using bad language, I am sure if you had a global high score table you don’t want any old text going up there… I have also made sure that the properties have a logical name for the member they are the property for, you can see I have named the member variables with camel case and the external property with initial upper case letters, this means I have the same name for the two entities but I can easily distinguish between the two in code.

    The properties are great for this, but what if you wanted to then display a message or indicate to the rest of the program that a bad name was given? You could still use properties and have another variable that indicates if a bad name has been used, the rest of the program could then check this and act accordingly, or you could use a function like this:

            public bool SetPlayerName(string name)
            {
                bool badName = false;

                // Code to detect if bad language has bee used
                // ...
                // ...

                if (!badName)
                    playerName = name;

                return badName;
            }

    We can now use this method to set the playerName, and the return result can then be used to know if we where successful or not. If you are doing this, what do you think you should do with the code in the constructor?? :)

    Inheritance

    We have seen how we can create a definition for the objects we are going to use in our programs and games, but wouldn't it be nice if we could create some basic building block objects and be able to extend and build a hierarchy of objects from it…? And that’s just what Inheritance is. Lets go back to our BaseVehilcle class, from this we could create a BaseRoadVehicle class which could look something like this:

    public class BaseRoadVehicle : BaseVehicle
        {
            protected int wheels;
            protected int Passengers;
            protected int cargoArea;
            protected int doors;        

            public BaseRoadVehicle() : base()
            {

            }
        }

    How easy was that! We created a new class of BaseRoadVehicle and inherited (derived) from BaseVehicle, this means that instances of the BaseRoadVehicle automaticaly get the Engine, FuelTank and all the other members of BaseVehicle as well as extending it with Wheels, Passengers, CargoArea and Doors, we could derive again from BaseRoadVehicle and create a BaseRoadBike class where we ensure that Wheels are never greater than 2 and Passengers > 1 and on and on, we can also, at the same time create a BaseWaterVehicle deriving from BaseVehicle or a BaseAirVehicle giving us a hierarchy of vehicle objects.

    Polymorphism

    Another awesome feature of OOP is Polymorphism. With this we can change the behavior of the base class methods (but only for this instance of the hierarchy), so for example, with out BaseRoadVehicle class we could have created a SetNumberOfWheels function to alter the number of wheels on a vehicle we could replace this function in our derived BaseRoadBike class by using the new keyword when defining out new method giving us two classes that look like this:

    public class BaseRoadVehicle : BaseVehicle
        {
            protected int wheels;
            protected int Passengers;
            protected int cargoArea;
            protected int doors;        

            public BaseRoadVehicle() : base()
            {

            }
            public int SetNumberOfWheels(int wheelCount)
            {
                wheels = wheelCount;

                return wheels;
            }
        }
        public class BaseRoadBike : BaseRoadVehicle
        {
            public BaseRoadBike() : base()
            {

            }
            public new int SetNumberOfWheels(int wheelCount)
            {
                if (wheelCount != 2)
                    wheels = 2;
                else
                    wheels = wheelCount;

                return wheels;
            }
        }

    Now when an object of the type BaseRoadVehicle uses the SetNumberOfWheels method, the wheels will ALWAYS be set to 2 no matter what number is passed in the wheelCount parameter. But what if we wanted to keep the original functionality of a method and add to it, then we would need to use an override. Lets create a class called BaseRoadBuss when setting wheel numbers for our bus we want them to always be an even number (I am yet to see a buss with an add number of wheels)

    public class BaseRoadVehicle : BaseVehicle
        {
            protected int wheels;
            protected int Passengers;
            protected int cargoArea;
            protected int doors;        

            public BaseRoadVehicle() : base()
            {

            }
            public virtual int SetNumberOfWheels(int wheelCount)
            {
                wheels = wheelCount;

                return wheels;
            }
        }
        public class BaseRoadBuss : BaseRoadVehicle
        {
            public BaseRoadBuss() : base()
            { }

            public override int SetNumberOfWheels(int wheelCount)
            {
                if ((wheelCount % 2) != 0)
                    wheelCount -= 1;

                return base.SetNumberOfWheels(wheelCount);
            }
        }

    So, we have changed the BaseRoadVehicle method and made it a virtual function, this means that any classes deriving from this class can override this method with there own version of it, which is what we have done in the BaseRoadBuss calss. In this overriden function we make sure that the wheel count is an even number, we then use the base class version of this function to set the wheels variable with the newly corrected value for wheelCount.

    There is a lot to take in in this post, OOP is a huge subject and I recommend you doing more reading on it to get a better handle that what I have given here, this is just the tip of the ice burg as far as OOP goes, but I hope I have given you enough to be getting on with and enough to help you see what we are going to d next….write a basic XNA game

    As ever, if you have ANY questions then please post them here or PM me and I will do my best to help you out. I have put the solution to this post here, it wont do much other than illustrate what we have gone over thus far. Oh, and if you see anything that you think I have worded badly, please let me know and I will correct it ASAP.

    Previous | Next

  • DXTop

    http://www.youtube.com/v/2yxbdaOdTxY <p><a href="http://www.youtube.com/v/2yxbdaOdTxY">http://www.youtube.com/v/2yxbdaOdTxY</a></p>

    So, as I was saying in my earlier post, I can render the app thumbnails on some textured quads, as you can see it is still a little glitchy, need to speed up the screen grab and bitblit, but not sure I can....

    So, putting multi touch support in there is next I guess as well as some nice particle effects for the touch pints as well as some audio ques...

    I recon I have the makings of a 3D desktop, what do you think...?

    You never know it may turn out useful lol

  • 3D Desktop.....well the start of one...

    http://www.youtube.com/v/76TQONRrgM0 <p><a href="http://www.youtube.com/v/76TQONRrgM0">http://www.youtube.com/v/76TQONRrgM0</a></p>

    I have been playing around with XNA using DWM, GDI and the good old Win32 API's and think I can create a kind of 3D desktop with them.

    The intention is to also leverage the Windows 7 Multi Touch API as well so you will be able to gesture from one application to the next, extract and inject data from one application to the next, all off my XNA desktop.

    I still have a number of glitches to iron out, and this clip shows the application just taking the current app that is in use and displaying a 2D representation of it in XNA. As you can imagine, now I have an image of a n application, I can now do anything I like with it in XNA.......Cool eh..

     As ever C&C welcome :)

  • XNA Focused ‘X48’ Conference Announced

    Just came across this in Edge-online.com 

    So, if any of you readers are taking part in either the Birmingham or Hudersfield event, it would be great to hear from you. Let us know how the event went, how you did and what you gaiend from the experience.

     Good luck to all those entering :)

    Posted Jan 14 2010, 09:42 AM by Nemo Krad with 4 comment(s)
    Filed under:
  • Blacksun Water As A Post Process

    http://www.youtube.com/v/9EJ_Q8VTbm0 <p><a href="http://www.youtube.com/v/9EJ_Q8VTbm0">http://www.youtube.com/v/9EJ_Q8VTbm0</a></p>  

    OK, my mate Dave found an awesome article on gamedev.net, it was describing how to render water without any geom by doing it as a post process.

    Here is my attempt at it so far. I still have much to do, bits to fix and add in, but I think it is looking OK now.

    If you want to have a look at the gamedev.net article you can find it here.

    Probably my last post for this year, in the new year, as well as continuing the Programming set of posts I will start to post what I have been doing with the Blacksun Engine, from the Asset manager to instancing, the deferred lighting and this water psot process.

    Merry Christmas and a Happy new year :D

  • Blacksun Terrain Systems

    http://www.youtube.com/v/VZGz8U89kOg <p><a href="http://www.youtube.com/v/VZGz8U89kOg">http://www.youtube.com/v/VZGz8U89kOg</a></p>  

    I have started to move some old and new stuff into the engine, in this clip you can see the start of my new terrain system. It's based on GeoClip mapping, but at the moment I am just brute forcing the terrain.

    All the calcs for the terrain are done on the GPU with the exception of the vert X and Z coord, everything else, the normals, height, tangent data, texture weights etc are all on the GPU. Gives me pretty economical large terrain :)

    Oh, spot the error in the clip if you can :) If you spot it I'll tell you how I corrected it....

  • Blacksun Post Processing

    http://www.youtube.com/v/DTPubVLm_g4 <p><a href="http://www.youtube.com/v/DTPubVLm_g4">http://www.youtube.com/v/DTPubVLm_g4</a></p>

    I have just added in my post processing framework, and I am shocked to find it does not dent the FPS one bit!

    In this clip you can see bloom, DoF, Radial Blur and a few others, I have had 13 post process effects and still not drop in performance.

    As ever C&C welcome..

  • Programming in C# with XNA – Programming Basics

    It’s been far too long since my last post on this set, but hope this will help make up for it. In this post we are going to cover some programming basics as I see them in this context. I am going break the concepts or areas up into three sections, “What is it?” or “What are they?”, “What does it/they look like?”, and “How do I use it/them?”. In the first section I will describe what the concept is, so no code, just a description of it. I will probably use quite visual terms so you can “see” what it is, rather than just giving you just the concept. Next, we will have a look at the concept, a look at the source code, I will then describe it’s components. and finally I will show how the concept is used and describe the kind of areas you would use it.

    Compiler Basics

    What is a computer program?

    Well, simply it is a list of instructions that the computer will obey. I think an important thing to remember is that the computer will carry out these instructions to the letter, it will make no assumptions of what you intend your instructions to do, it will do EXACTLY what you tell it to do.

    So we now know that a program is a list of instructions for your computer to carry out, but how do we give the computer these instructions? Well that’s where a programming language comes in like C#. Now, as I am sure you are aware, your computer does not understand English, or what ever your native tongue is, and in fact it doesn’t even understand the programming language. This is what the compiler is for, it takes the instructions you have written in C# and ‘compiles’ it into a language the machine understands directly and is able to act on. This compiled code (in the case of a windows application) is a .exe file. Now the compiler we will be using is Visual Studio and once we have written our instructions we can get it to compile our code and we can then play our game.

    Now with this in mind, the project we have just created already has instructions as we can see in the project we have a Program.cs and Game1.cs file, so without even entering a new line of code we can compile and execute this code. At the top of your IDE in the menu you have an option called ‘Build’, move your mouse over it and a number of options will appear.

    RCBuild

    Click the ‘Build Solution’ option, as you can see you can also just press F6. Now if you are quick you should see the compiler telling you it has started the build process in the bottom left corner.

    RCBuildStarted

    And once done, it will tell you it has completed. Now there is a much better way of seeing what goes on during the build process,this is important to know as you are going to write some code that just wont build for a number of reasons, most common of which you will make typo’s that will stop the build process. To get more information return to the menu at the top, click ‘View’ and then click ‘Output’, again, there is a short cut, you can open this view by pressing Ctrl+W then O

    RCViewOutput

    You should now have the output window open, and you should be able to see messages from the build process which should now look like this

    RCOutputWindow

    Now that we have compiled our project, lets run it! So, back to the menu, click ‘Debug’ then click ‘Start Debugging’, and again there is a short cut, F5. And HEY PRESTO! We have a game running!! OK, it’s not Gears Of War or Halo 3, but it’s a start… Also, if you look back at the output window you will see a new set of messages :)

    You now know how to build and execute the project, so I think it’s more than about time we start learning how to code.

    Variables

    What are they?

    I think the best way to think of these are as box’s that we can put things in, for example, if you have a shoe box, you would use that to put shoes in, in the real world you can put what ever fits into a shoe box, but for the purposes of this tutorial, only what the box was made for can be stored. So, in our game, we will want to store the players score, so we will need to use a variable to do this or the players name, lives, health etc..

    What do they look like?

    Now in C# we have a lot of variable types, in other words lots of kinds of box’s to put things in. Here are a few of them:

            char c;
            int i;
            byte b;
            string s;
            object o;
            Vector2 v2;
            Matrix m;

    There are many, many more and you can create your own. The type of variable you choose to use is important, in the list above there is a ‘char’, this is used to store a single character, an ‘int’, this will store an integer (a whole number, a number without a decimal point), a ‘byte’, this will store a number in the range of 0 to 255, a ‘string’, this is used for storing words and sentences; in fact this post it just a load of strings, an ‘object’, now this one is a bit special and can store anything but you should avoid using them :), a ‘Vector2’ this stores coordinates, like on a map, and finally a ‘Matrix’, we probably wont cover these here, but I put them in so you know of them. As you can see the variables here are made up from two parts, the type and the name of the variable. You have probably noticed that some types are in blue and others in, well a lighter blue, that is because the later two are structures, we wont cover this now, just remember they are a type.

    How do I use them?

    As I have already mentioned we use variables to store information (data), so lets look at the two examples I gave above, the players score and the players name, so I would put the players score in an ‘int’ and his name in a ‘string’. It’s important to choose the right variable types to store the data we want, for example, I could have used the ‘byte’ type to store the plyers score, but our score could then only go up to 255, and I am sure we will want more range than that..

            string playerName;
            int playerScore;

    The naming of our variable names is important too, we should give them sensible and logical names that describe there use, so in the case of our player score and player name I have called them just that, ‘playerName’ and ‘playerScore’, you can also see I have not made the first letter a capital (upper case) this is because I use a variable naming convention called CamelCase, now we wont use this in all naming instances, but for local variables (we will discuss local variables next) we will.

    This is called ‘declaring’ variables, and when I declare my variables I like to set their values so I know there content from the start (might be the old C programmer in me) and we do it like this:

            string playerName = string.Empty;
            int playerScore = 0;

    So, in those two lines of code we have created two variables (box’s), logically named them and given them values (put data in the box’s)

    Scope

    What is it?

    Scope is the ‘visibility’  of our variables, what parts of our program can see and use them. The scope of a variable is within the ‘{ }’ braces that is is declared within. We can also add ‘Access Modifiers’ to a variable to extend it’s scope.

    What does it look like? & How do I use it?

    Here I have put in our two new variables at the top of our Game1 class, I have also created a new variable in the constructor (I’ll get onto constructors later) called ‘enemyName’

        public class Game1 : Microsoft.Xna.Framework.Game
        {
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;

            string playerName = string.Empty;
            int playerScore = 0;

            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";

                string enemyName = string.Empty;

                playerName = "Player 1";
                playerScore = 0;
            }

            /// <summary>
            /// Allows the game to perform any initialization it needs to before starting to run.
            /// This is where it can query for any required services and load any non-graphic
            /// related content.  Calling base.Initialize will enumerate through any components
            /// and initialize them as well.
            /// </summary>
            protected override void Initialize()
            {
                // TODO: Add your initialization logic here
                enemyName = "Bad Dude 1";
                base.Initialize();
            }

    So, our first two variables have a scope that is visible throughout the whole of the class and so can be accessed and used in the constructor for Game1, where we set the players name to be “Player 1” and ensure he has a score of 0. We also created a new variable for the name of our enemy, the scope of this variable is ONLY visible in the constructor and so where I have tried to use it in the Initialize method will cause a compile error (Hit F5 and see)

    I will go onto access modifiers when we look at creating our own types later.

    Decision Making & Flow Control

    What is it?

    This concept is where the actual game mechanics reside, it’s how we will know when to increment the score, reduce the players lives or end the game. In C# we have a few devices at our disposal, the ‘if’ statement, ‘switch’ and a variety of mechanisms to loop the flow and with in them methods to control the loops.

    What do they look like? & How do I use them?

    With the ‘if’ statement we can decide if we want to execute a block of code or not.

                if (playerLives == 0)
                {
                    // Code to end the game here ...
                }

    So, with this ‘if’ statement I am saying, if the variable playerLives is 0 then I want to run the code that will do my end game stuff. Notice I am using ‘==’ to check if the variable is ‘equal to’ 0 (checking the contents of the box) and not setting the variable to the value of 0 (putting 0 in the box).

    With the ‘if’ statement also comes the ‘else’, this can be used to execute code should the ‘if’ condition fail.

                if (playerHealth <= 0)
                    playerLives--;
                else
                {
                    if(playerHealth != 100)
                        playerHealth += .5f;
                }

    Here we have a slightly more complicated ‘if’ statement, if the players health is less than or equal to 0 then the player loses a life, ‘else’ we are the checking if the players health is not (!) equal to 100 then we add .5 to it. We have seen a few conditional statements now what other statements are there? Well here is a list of all the logical operators.

            ==    variable equal to
            >    variable greater then
            >=    variable greater than or equal to
            <    variable less than
            <=    variable less than or equal to
            !    variable not
            !=    variable not equal to

    We can also check more than one condition in an if statement by using the ‘&&’ (and) and ‘||’ (or) operators like this

                if (playerScore >= 1000 && playerScore <= 1500 && !hadExtraLife)
                {
                    hadExtraLife = true;
                    playerLives++;
                }

    What we are doing here is saying if the players score is greater than or equal to 1000 and the players score is less than or equal to 1500 (players score between 1000 and 1500) and we have not already given an extra life, then we set the hadExtraLife variable to true and add one to the players life counter.

    The ‘switch’ statement is not so flexible but you can literally use it to switch between conditions

                switch (playerScore)
                {
                    case 500:
                        playerLives++;
                        break;
                    case 1000:
                        playerLives++;
                        break;
                    case 1500:
                        playerLives++;
                        break;
                    case 2000:
                        playerLives++;
                        break;
                }

    What this block of code will do is add one to the players lives if there score is equal to 500,1000, 1500 or 2000. You will also see in here a command called ‘break’ this will be covered more in the loops.

    So a loop is a way of executing a block of code multiple times, there are again a number of methods at our disposal to do this, the ‘while’, ‘do while’ and ‘for’ loops, so lets have a look at them (there is also a ‘foreach’ but again we will cover that later)

                while (playerLives > 0)
                {
                    // Do some stuff over and over..
                }

                do
                {
                    // Do some stuff over and over..
                } while (playerLives > 0);

                for (int i = 0; playerLives > 0; i++)
                {
                    // Do some stuff over and over..
                }

    The ‘while’ loop execute until the condition is no longer met, the players lives are less than or equal to 0, so if the players lives are 0 before we get to star the loop the loop may never execute. The ‘do while’ loop will execute at least once as the condition is not checked until the end of the loop, and again the loop will run until the condition is no longer met. The ‘for’ loop is about the most complex loop we have as we can setup a variable, in this case the ‘int’ i who’s scope will be the ‘for’ loop, a test condition, and then also increment the new variable (and and other for that matter).

    So what happens if something happens in the loop that makes me want to either leave it or return to the top again? Well that’s where ‘break’ and ‘continue’ come in. see the loop below

                while (playerLives > 0)
                {
                    // Do some stuff over and over..

                    if (playerScore >= 50)
                        continue;

                    if (playerHealth == 1)
                        break;
                }

    I guess not the most logical example, but I am using it to show you the mechanism, so in this example, we will continue to execute our loop while the players lives are greater than 0, if the players score is greater or equal to 50 then we will go no further in the loop and return back to the top and start gain, if the players health is equal to 1 then we will exit the loop.

    So, we have dipped out toe into programming, if you are following this set of posts, then please make sure you understand the concepts I am trying to explain here before moving onto the nest post. If you have ANY questions on ANYTHING covered here then please don’t hesitate to ask, either comment here on this post, or PM me and I will do my best to help you out. By all means, google and research any of the topics here for more information on them, there are plenty of resources out there.

    Previous | Next

  • XBLIG-UK December 2009

    Well what a great day that was! I gave my first public talk on XNA at the XBLIG-UK event, not sure if I put too much in, left too much out, but I enjoyed it none the less. It was organized by Edward Powel (our VeraShackle) over at the NxtGen UK UG

    We had talks about the Zune HD from Paul Foster a Microsoft Evangialist, myself whittering on about UV mapping in Blender3D (Note to self: must get the new version), then John Hampson with procedural implementation in XNA (check out Britonia, that’s Johns stuff!), then Dr Nick Hawes on how Academic A.I. could be used in Gaming, Steve Miles great talk on overriding the native SpriteBatch, our very own Dave Bonner from Dark Omen Games describing the XBLIG publishing process, fellow MVP Rich Costall showing off a child spawned from the mixing of XNA and Silverlight , Salvatore Fileccia from Rare who went over the good and bad times implementing Physics with Banjo Kazooie, an awesome talk by Paul Manzotti on the implementation of sound using XACT, and naturally a great talk by Edward Powel on the use of content importers!!

    Yes!! It was a very full day and wass 99.9% glitch free too!

    I think that the NxtGen guys will be putting some pics up and links to all the speakers presentations, the XNA project I used to show the UV mapping will be there as well as my presentation, so you will be able to see how much I left out due to time. They have just put up a pod cast about the day which can be listened to here, now, I as there honest, though you might not know that from the pod cast :P

    If you did attend, let me know what you thought of my talk, it was my first so I am not sure if I left too much out or it all went over peoples heads :) C&C is welcome.

More Posts Next page »