<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mach X Games Blog</title>
	<atom:link href="http://machxgames.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://machxgames.com/blog</link>
	<description>Adventures in Indie XNA Game Development</description>
	<lastBuildDate>Tue, 28 Feb 2012 22:18:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Speech Bubble Sample</title>
		<link>http://machxgames.com/blog/?p=118</link>
		<comments>http://machxgames.com/blog/?p=118#comments</comments>
		<pubDate>Tue, 28 Feb 2012 22:18:18 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[conversation]]></category>
		<category><![CDATA[npc]]></category>
		<category><![CDATA[RPG]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=118</guid>
		<description><![CDATA[So I allowed myself to get sidetracked to throw together a sample to answer a question in the App Hub forums. Since I love RPG games, both playing and developing, this will probably be useful to me sometime in the future so that’s how I’m justifying it. The sample, which you can get from here, [...]]]></description>
			<content:encoded><![CDATA[<p>So I allowed myself to get sidetracked to throw together a sample to answer <a href="http://forums.create.msdn.com/forums/t/100814.aspx">a question</a> in the App Hub forums. Since I love RPG games, both playing and developing, this will probably be useful to me sometime in the future so that’s how I’m justifying it.</p>
<p>The sample, which you can get from <a href="http://machxgames.com/files/downloads/samples/SpeechBubbleSample.zip">here</a>, shows a quick semi-dynamic speech bubble with a couple of options. The class is less than 150 lines, allows however many lines of text you want, shows a graphic to let the user know if there’s more text that the character has to provide, and shows a pointer to the character that can be placed on either the left or right side of the bottom of the bubble. It uses more of my fantastic programmer art, but should work with whatever graphics you replace it with, assuming you don’t deviate from how I’ve set up the graphics. I could have used just one corner graphic and rotated for the other 3 sides, but I was lazy. <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-smile1.png" /></p>
<p>Here’s the class in all its glory:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">enum</span> PointerType
{
    None,
    Left,
    Right
}

<span class="kwrd">public</span> <span class="kwrd">class</span> SpeechBubble
{
    <span class="kwrd">private</span> <span class="kwrd">int</span> _width;

    <span class="kwrd">private</span> Vector2 _location;

    <span class="kwrd">private</span> <span class="kwrd">string</span>[] _text;

    <span class="kwrd">private</span> SpriteFont _font;

    <span class="rem">//bubble textures</span>
    <span class="kwrd">private</span> Texture2D _bottomBorder;
    <span class="kwrd">private</span> Texture2D _interior;
    <span class="kwrd">private</span> Texture2D _leftBorder;
    <span class="kwrd">private</span> Texture2D _leftBottomCorner;
    <span class="kwrd">private</span> Texture2D _leftTopCorner;
    <span class="kwrd">private</span> Texture2D _rightBorder;
    <span class="kwrd">private</span> Texture2D _rightBottomCorner;
    <span class="kwrd">private</span> Texture2D _rightTopCorner;
    <span class="kwrd">private</span> Texture2D _topBorder;

    <span class="kwrd">private</span> <span class="kwrd">bool</span> _more;
    <span class="kwrd">private</span> Texture2D _moreGraphic;

    <span class="kwrd">private</span> PointerType _pointerType;
    <span class="kwrd">private</span> Texture2D _pointer;

    <span class="kwrd">public</span> SpeechBubble(ContentManager content, <span class="kwrd">int</span> width, Vector2 location, <span class="kwrd">string</span>[] text, <span class="kwrd">bool</span> more = <span class="kwrd">false</span>, PointerType pointerType = PointerType.None)
    {
        _font = content.Load&lt;SpriteFont&gt;(<span class="str">&quot;font&quot;</span>);

        _bottomBorder = content.Load&lt;Texture2D&gt;(<span class="str">&quot;bottomBorder&quot;</span>);
        _interior = content.Load&lt;Texture2D&gt;(<span class="str">&quot;interior&quot;</span>);
        _leftBorder = content.Load&lt;Texture2D&gt;(<span class="str">&quot;leftBorder&quot;</span>);
        _leftBottomCorner = content.Load&lt;Texture2D&gt;(<span class="str">&quot;leftBottomCorner&quot;</span>);
        _leftTopCorner = content.Load&lt;Texture2D&gt;(<span class="str">&quot;leftTopCorner&quot;</span>);
        _rightBorder = content.Load&lt;Texture2D&gt;(<span class="str">&quot;rightBorder&quot;</span>);
        _rightBottomCorner = content.Load&lt;Texture2D&gt;(<span class="str">&quot;rightBottomCorner&quot;</span>);
        _rightTopCorner = content.Load&lt;Texture2D&gt;(<span class="str">&quot;rightTopCorner&quot;</span>);
        _topBorder = content.Load&lt;Texture2D&gt;(<span class="str">&quot;topBorder&quot;</span>);

        _moreGraphic = content.Load&lt;Texture2D&gt;(<span class="str">&quot;more&quot;</span>);

        _pointer = content.Load&lt;Texture2D&gt;(<span class="str">&quot;pointer&quot;</span>);

        _location = location;
        _width = width;

        _text = text;

        _more = more;

        _pointerType = pointerType;
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> Draw(SpriteBatch sb)
    {
        <span class="rem">//top</span>
        sb.Draw(_leftTopCorner, _location, Color.White);
        sb.Draw(_topBorder, <span class="kwrd">new</span> Rectangle((<span class="kwrd">int</span>)_location.X + _leftTopCorner.Width, (<span class="kwrd">int</span>)_location.Y, _width - _leftTopCorner.Width * 2, _leftTopCorner.Height), Color.White);
        sb.Draw(_rightTopCorner, _location + <span class="kwrd">new</span> Vector2(_width - _rightTopCorner.Width, 0), Color.White);

        <span class="rem">//lines</span>
        <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; _text.Length + (_more ? 1 : 0); i++)
        {
            sb.Draw(_leftBorder, <span class="kwrd">new</span> Vector2(_location.X, _location.Y + _leftTopCorner.Height + (i * _leftBorder.Height)), Color.White);
            sb.Draw(_interior, <span class="kwrd">new</span> Rectangle((<span class="kwrd">int</span>)_location.X + _leftBorder.Width,
                                    (<span class="kwrd">int</span>)_location.Y + _leftTopCorner.Height + (i * _leftBorder.Height),
                                    _width - _leftBorder.Width * 2,
                                    _leftBorder.Height),
                    Color.White);
            sb.Draw(_rightBorder, <span class="kwrd">new</span> Vector2(_location.X + _width - _rightBorder.Width, _location.Y + _leftTopCorner.Height + (i * _leftBorder.Height)), Color.White);

            <span class="rem">//leave space for more graphic if necessary</span>
            <span class="kwrd">if</span> (i &lt; _text.Length)
                sb.DrawString(_font, _text[i], <span class="kwrd">new</span> Vector2((<span class="kwrd">int</span>)_location.X + _leftBorder.Width, (<span class="kwrd">int</span>)_location.Y + _leftTopCorner.Height + (i * _leftBorder.Height)), Color.Black);
        }

        <span class="rem">//bottom</span>
        sb.Draw(_leftBottomCorner, _location + <span class="kwrd">new</span> Vector2(0, _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height), Color.White);

        <span class="kwrd">switch</span>(_pointerType)
        {
            <span class="kwrd">case</span> PointerType.Left:
            {
                sb.Draw(_pointer, _location + <span class="kwrd">new</span> Vector2(_leftBottomCorner.Width, _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height), Color.White);

                sb.Draw(_bottomBorder, <span class="kwrd">new</span> Rectangle((<span class="kwrd">int</span>)_location.X + _leftBorder.Width + _pointer.Width,
                                                        (<span class="kwrd">int</span>)_location.Y + _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height,
                                                        _width - _leftBorder.Width - _pointer.Width - _rightBorder.Width,
                                                        _bottomBorder.Height),
                                        Color.White);

                <span class="kwrd">break</span>;
            }
            <span class="kwrd">case</span> PointerType.Right:
            {
                sb.Draw(_bottomBorder, <span class="kwrd">new</span> Rectangle((<span class="kwrd">int</span>)_location.X + _leftBorder.Width,
                                                    (<span class="kwrd">int</span>)_location.Y + _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height,
                                                    _width - _leftBorder.Width - _pointer.Width - _rightBorder.Width,
                                                    _bottomBorder.Height),
                                        Color.White);

                sb.Draw(_pointer, _location + <span class="kwrd">new</span> Vector2(_width - _pointer.Width - _rightBorder.Width, _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height), Color.White);

                <span class="kwrd">break</span>;
            }
            <span class="kwrd">case</span> PointerType.None:
            {
                sb.Draw(_bottomBorder, <span class="kwrd">new</span> Rectangle((<span class="kwrd">int</span>)_location.X + _leftBorder.Width,
                                                    (<span class="kwrd">int</span>)_location.Y + _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height,
                                                    _width - _leftBorder.Width - _rightBorder.Width,
                                                    _bottomBorder.Height),
                                        Color.White);

                <span class="kwrd">break</span>;
            }
        }

        sb.Draw(_rightBottomCorner, _location +  <span class="kwrd">new</span> Vector2(_width - _rightBottomCorner.Width, _leftTopCorner.Height + (_text.Length + (_more ? 1 : 0)) * _leftBorder.Height), Color.White);

        <span class="kwrd">if</span> (_more)
            sb.Draw(_moreGraphic, <span class="kwrd">new</span> Vector2(_location.X + _width - _rightBorder.Width - _moreGraphic.Width, _location.Y + _leftTopCorner.Height + (_text.Length * _leftBorder.Height)), Color.White);
    }
}</pre>
<p>&#160;</p>
<p>Creating an instance is fairly straightforward:</p>
<pre class="csharpcode">SpeechBubble _bubble1;
SpeechBubble _bubble2;
SpeechBubble _bubble3;

<span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> LoadContent()
{
      ...

      _bubble1 = <span class="kwrd">new</span> SpeechBubble(Content, 150, <span class="kwrd">new</span> Vector2(50, 50), <span class="kwrd">new</span> <span class="kwrd">string</span>[] { <span class="str">&quot;This is a test&quot;</span>, <span class="str">&quot;This is only a test&quot;</span>, <span class="str">&quot;More text follows...&quot;</span> }, <span class="kwrd">true</span>);
      _bubble2 = <span class="kwrd">new</span> SpeechBubble(Content, 150, <span class="kwrd">new</span> Vector2(250, 250), <span class="kwrd">new</span> <span class="kwrd">string</span>[] { <span class="str">&quot;This is a test&quot;</span>, <span class="str">&quot;This is only a test&quot;</span>, <span class="str">&quot;Nothing here&quot;</span> },<span class="kwrd">false</span>, PointerType.Left);
      _bubble3 = <span class="kwrd">new</span> SpeechBubble(Content, 150, <span class="kwrd">new</span> Vector2(150, 450), <span class="kwrd">new</span> <span class="kwrd">string</span>[] { <span class="str">&quot;Another test&quot;</span>, <span class="str">&quot;Still testing&quot;</span>, <span class="str">&quot;More follows...&quot;</span> }, <span class="kwrd">true</span>, PointerType.Right);
}</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Simply call the Draw method of the class in your own draw code:</p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    spriteBatch.Begin();
    _bubble1.Draw(spriteBatch);
    _bubble2.Draw(spriteBatch);
    _bubble3.Draw(spriteBatch);
    spriteBatch.End();

    <span class="kwrd">base</span>.Draw(gameTime);
}</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Feel free to let me know if I missed something that would be useful in the class.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=118</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Adding Triggers to the Platformer Starter Kit</title>
		<link>http://machxgames.com/blog/?p=115</link>
		<comments>http://machxgames.com/blog/?p=115#comments</comments>
		<pubDate>Wed, 15 Feb 2012 16:51:23 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Platformer]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=115</guid>
		<description><![CDATA[I’ve seen a lot of posts where people are using the Platformer Starter Kit and as I was reading one, I thought having the ability to have triggers in a level might be something someone would find useful. Triggers give the level designer the ability to make levels more challenging and diverse, instead of simply [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve seen a lot of posts where people are using the Platformer Starter Kit and as I was reading one, I thought having the ability to have triggers in a level might be something someone would find useful.</p>
<p>Triggers give the level designer the ability to make levels more challenging and diverse, instead of simply having the player run around collecting gems and power-ups in a wide open level. The added dimension of a goal that may have to be reached before exiting the level makes the game more challenging, which leads to the game possibly being more interesting to play.</p>
<p>The first use that I thought of for a trigger was to remove a block( s ) that impedes reaching the exit. Should be simple enough, right? Let’s find out.</p>
<p>I started out by figuring that two kinds of triggers might be good to have – visible and invisible. Even though triggers aren’t tiles, the level designer needs to see them in the level data, which means the code that reads the text files that hold the level data have to account for them. “T” and “I” are what I selected for the two trigger types.</p>
<p>In the Level.cs file’s LoadTile method, add the following to the end of the switch statement before the “default” case:</p>
<pre class="csharpcode"><span class="rem">// visible trigger</span>
<span class="kwrd">case</span> <span class="str">'T'</span>:
   <span class="kwrd">return</span> <span class="kwrd">new</span> Tile(<span class="kwrd">null</span>, TileCollision.Passable);

<span class="rem">//invisible trigger</span>
<span class="kwrd">case</span> <span class="str">'I'</span>:
   <span class="kwrd">return</span> <span class="kwrd">new</span> Tile(<span class="kwrd">null</span>, TileCollision.Passable);</pre>
<p>&#160;</p>
<p>For the visible trigger, the player will have to have something to see, which means we’ll need a sprite. Behold, the awesome programmer art!</p>
<p><a href="http://machxgames.com/blog/wp-content/uploads/2012/02/trigger.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="trigger" border="0" alt="trigger" src="http://machxgames.com/blog/wp-content/uploads/2012/02/trigger_thumb.png" width="36" height="36" /></a></p>
<p>I placed the file in the Sprites folder in the Content project.</p>
<p>The sprite doesn’t look exactly like this (at least not as I’m typing this). You can open the file in the attached source linked to at the bottom of this post to see it. The important thing is to ensure that whatever you use is sized correctly (I just opened the gem.png file and had at it) and has a transparent background.</p>
<p>The sprite needs an object to load it into and we’ll need something to hold one or more triggers in the level, so add the following at the top of the Level.cs file’s Level class:</p>
<pre class="csharpcode"><span class="kwrd">private</span> List&lt;Trigger&gt; triggers = <span class="kwrd">new</span> List&lt;Trigger&gt;();
<span class="kwrd">private</span> Texture2D triggerTexture;</pre>
<p>&#160;</p>
<p>The Trigger class looks like this:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">enum</span> TileTriggerType
{
    None,
    MoveTile,
    RemoveTile
}

<span class="kwrd">public</span> <span class="kwrd">class</span> Trigger
{
    <span class="kwrd">public</span> Vector2 Location;
    <span class="kwrd">public</span> <span class="kwrd">bool</span> IsTriggerVisible = <span class="kwrd">true</span>;
    <span class="kwrd">public</span> Vector2 TriggerTarget = Vector2.Zero;
    <span class="kwrd">public</span> TileTriggerType TriggerType = TileTriggerType.None;
    <span class="kwrd">public</span> <span class="kwrd">bool</span> IsActive = <span class="kwrd">true</span>;
}</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Since the text file that holds the level data is fairly set in stone as far as it’s content, we’ll use separate files to hold the data for a trigger. I decided on something fairly straightforward as far as format:</p>
<pre class="csharpcode">69,13|2|70,0|1</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>The pipe character separates the pieces of data. The first piece is the location of the trigger, the second the type of trigger, the third, the location of the tile that the trigger acts upon, the last whether or not the trigger is visible.</p>
<p>The following code reads the trigger file for the current level:</p>
<pre class="csharpcode"><span class="rem">//load level triggers data</span>
<span class="kwrd">try</span>
{
    <span class="kwrd">using</span> (Stream stream = TitleContainer.OpenStream(<span class="str">&quot;Content/triggers/&quot;</span> + levelIndex.ToString() + <span class="str">&quot;.txt&quot;</span>))
    {
        <span class="kwrd">using</span> (StreamReader sr = <span class="kwrd">new</span> StreamReader(stream))
        {
            <span class="kwrd">string</span> line = sr.ReadLine();

            <span class="kwrd">while</span> (line != <span class="kwrd">null</span>)
            {
                Trigger trigger = <span class="kwrd">new</span> Trigger();

                <span class="kwrd">string</span>[] data = line.Split(<span class="str">'|'</span>);

                Vector2 vec = <span class="kwrd">new</span> Vector2(Convert.ToInt16(data[0].Substring(0, data[0].IndexOf(<span class="str">','</span>))), Convert.ToInt16(data[0].Substring(data[0].IndexOf(<span class="str">','</span>) + 1)));
                trigger.Location = vec;
                trigger.TriggerType = (TileTriggerType)Convert.ToInt16(data[1]);
                vec = <span class="kwrd">new</span> Vector2(Convert.ToInt16(data[2].Substring(0, data[2].IndexOf(<span class="str">','</span>))), Convert.ToInt16(data[2].Substring(data[2].IndexOf(<span class="str">','</span>) + 1)));
                trigger.TriggerTarget = vec;
                trigger.IsTriggerVisible = data[3] == <span class="str">&quot;1&quot;</span> ? <span class="kwrd">true</span> : <span class="kwrd">false</span>;

                triggers.Add(trigger);

                line = sr.ReadLine();
            }
        }
    }
}
<span class="kwrd">catch</span> (Exception ex)
{
    <span class="rem">//do nothing</span>

}

triggerTexture = Content.Load&lt;Texture2D&gt;(<span class="str">&quot;Sprites/trigger&quot;</span>);</pre>
<p>&#160;</p>
<p>The last piece of the puzzle is to handle the player hitting the trigger. Add the following to the Update method of the Level class after the UpdateEnemies(gameTime) line:</p>
<pre class="csharpcode"><span class="rem">//check for hitting trigger</span>
<span class="kwrd">if</span> (Player.IsAlive &amp;&amp; Player.IsOnGround)
{
    <span class="kwrd">foreach</span>(Trigger trigger <span class="kwrd">in</span> triggers)
    {
        <span class="kwrd">if</span>(trigger.IsActive)
        {
            <span class="rem">//offset to center of trigger texture</span>
            <span class="kwrd">if</span> (Player.BoundingRectangle.Contains((<span class="kwrd">int</span>)trigger.Location.X * Tile.Width + Tile.Width / 2, (<span class="kwrd">int</span>)trigger.Location.Y * Tile.Height + Tile.Height / 2))
            {
                trigger.IsActive = <span class="kwrd">false</span>;
                <span class="kwrd">switch</span> (trigger.TriggerType)
                {
                    <span class="kwrd">case</span> TileTriggerType.MoveTile:
                    {

                        <span class="kwrd">break</span>;
                    }
                    <span class="kwrd">case</span> TileTriggerType.RemoveTile:
                    {
                        tiles[(<span class="kwrd">int</span>)trigger.TriggerTarget.X, (<span class="kwrd">int</span>)trigger.TriggerTarget.Y] = <span class="kwrd">new</span> Tile(<span class="kwrd">null</span>, TileCollision.Passable);

                        <span class="kwrd">break</span>;
                    }
                }
            }
        }
    }
}</pre>
<p>&#160;</p>
<p>I’ve only handled the RemoveTile trigger type. I’m leaving the MoveTile as an exercise for the reader (that’s my story and I’m sticking to it!).</p>
<p>I modified the first level to add a wall blocking the exit and set the trigger near it so the player can see the tile being removed:</p>
<pre class="csharpcode">......................................................................#.......
......................................................................#.......
...........................G..........................................#.......
..........................###.........................................#.......
......................G...............................................#....X..
.....................###................G.GDG.............G.G.G...############
.................G....................#########..........#######..............
................###...........................................................
............P...................G.G...............G.G.........................
...........###.................#####.............#####........................
.......G......................................................................
......###...............................GDG.G.............G.G.G.G.G.G.G.G.G.G.
......................................#########.........##.G.G.G.G.G.G.G.G.G..
.1........................................................GCG.G.GTGCG.G.G.GCG.
####################......................................####################</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Save everything and give it a try. Assuming I didn’t miss anything you should be able to hit the trigger and see the top block in the wall disappear, enabling you to reach the exit. If I did miss something please let me know. In that case you can download the source from <a href="http://machxgames.com/files/downloads/samples/PlatformerGSM_lives_scrolling_powerups_movabletiles_triggers.zip">here</a> and give it a try.</p>
<p>Other possible triggers that I could see being useful:</p>
<ul>
<li>Moving blocks to enable the player to reach areas not accessible otherwise</li>
<li>Moving blocks to crush enemies (this would be a pretty big modification)</li>
<li>Moving blocks to prevent enemies from reaching and area and allowing the player to safely move through that area</li>
<li>Moving blocks to allow access to power-ups</li>
</ul>
<ul>One thing that currently isn’t handled by this code is the ability to have a trigger modify multiple tiles. This isn’t a big enhancement. Simply change the TriggerTarget member of the Trigger class to a List&lt;Vector2&gt;, change the code to read the trigger file to handle one or more pieces of data (possibly by making the target data the last piece of data read) and changing the code in the Level class Update method to loop through this List.</ul>
<ul>There are a lot of areas of level design that are opened up by a pretty simple modification to the game code. I’d love to see what people can come up with.</ul>
<ul>If anyone can think of other small enhancements to the kit, let me know.</ul>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying Platformer Starter Kit&#8211;Adding Health</title>
		<link>http://machxgames.com/blog/?p=112</link>
		<comments>http://machxgames.com/blog/?p=112#comments</comments>
		<pubDate>Sat, 11 Feb 2012 17:26:36 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Platformer]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=112</guid>
		<description><![CDATA[So there was another post on the AppHub forums where someone was asking about how to add health to the character in the Platformer Starter Kit rather than having him die immediately when touching an enemy. I’d cobbled together a bunch of mods that had previously been done and thought this might make another good [...]]]></description>
			<content:encoded><![CDATA[<p>So there was another post on the AppHub forums where someone was asking about how to add health to the character in the Platformer Starter Kit rather than having him die immediately when touching an enemy. I’d cobbled together a bunch of mods that had previously been done and thought this might make another good one.</p>
<p>Implementing this turned out to be pretty simple. Just two files need updating, Level.cs and Player.cs and I added two sprites – a health bar and a 1&#215;1 pixel texture to fill in the healthbar.</p>
<p><a href="http://machxgames.com/blog/wp-content/uploads/2012/02/healthbar.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="healthbar" border="0" alt="healthbar" src="http://machxgames.com/blog/wp-content/uploads/2012/02/healthbar_thumb.png" width="204" height="36" /></a></p>
<p><a href="http://machxgames.com/blog/wp-content/uploads/2012/02/health.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="health" border="0" alt="health" src="http://machxgames.com/blog/wp-content/uploads/2012/02/health_thumb.png" width="93" height="93" /></a></p>
<p>(magnified may times <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-openmouthedsmile" alt="Open-mouthed smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-openmouthedsmile.png" />)</p>
<p>&#160;</p>
<p>First, the changes to the Player.cs file. At the top where all the members are declared add:</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">int</span> health = 100;
<span class="rem">//private int lives = 3;</span>
<span class="kwrd">private</span> <span class="kwrd">int</span> lives = 1;
<span class="kwrd">private</span> <span class="kwrd">bool</span> touchingEnemy;

<span class="kwrd">public</span> <span class="kwrd">bool</span> TouchingEnemy
{
    get { <span class="kwrd">return</span> touchingEnemy; }
    set { touchingEnemy = <span class="kwrd">value</span>; }
}

<span class="kwrd">public</span> <span class="kwrd">int</span> Health
{
    get { <span class="kwrd">return</span> health; }
}</pre>
<p>&#160;</p>
<p>Notice, the old “lives” member has been commented out and replaced. The player now only has one life, but can be injured a number of times before dying (which we’ll see in a second).</p>
<p>Previously, when the player was touched by an enemy the OnKilled method was called. We need to add a new method (I put it right under the OnKilled method):</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">void</span> OnInjured()
{
    touchingEnemy = <span class="kwrd">true</span>;

    health -= 10;

    <span class="kwrd">if</span> (health == 0)
    {
        killedSound.Play();
        sprite.PlayAnimation(dieAnimation);
        isAlive = <span class="kwrd">false</span>;
    }
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Now we’ll add the textures necessary to render the health bar and the members of the level class to load the textures into. </p>
<p>You can either save the textures above by right-clicking on them, create your own, or grab them out of the zip file attached to this post. Drop them into the “sprites” folder in the content project (or wherever you want, but you’ll have to change the relevant code that loads them).</p>
<p>Add the following code to the Level.cs file’s section where the other members are declared:</p>
<pre class="csharpcode">
<span class="kwrd">private</span> Texture2D healthBar;
<span class="kwrd">private</span> Vector2 healthBarLoc;
<span class="kwrd">private</span> Texture2D healthTexture;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Then add the following to the Level.cs constructor:</p>
<pre class="csharpcode">
<span class="rem">//load healthbar textures</span>
healthBar = Content.Load&lt;Texture2D&gt;(<span class="str">&quot;sprites/healthbar&quot;</span>);
healthTexture = Content.Load&lt;Texture2D&gt;(<span class="str">&quot;sprites/health&quot;</span>);
healthBarLoc = <span class="kwrd">new</span> Vector2(Width * Tile.Width - 205, 5);</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>The Width member of the Level class returns the width of the screen measure in number of tiles, so we have to do a little multiplication and offset from the edges of the screen a bit.</p>
<p>Now add the matching method to injure the player that we had in the Player class (again, I added this right below the OnKilled method):</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> OnPlayerInjured()
{
    Player.OnInjured();
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>And we’ll call it in the UpdateEnemies method:</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> UpdateEnemies(GameTime gameTime)
{
    <span class="kwrd">foreach</span> (Enemy enemy <span class="kwrd">in</span> enemies)
    {
        enemy.Update(gameTime);

        <span class="rem">// Touching an enemy now just injures the player</span>
        <span class="kwrd">if</span> (enemy.BoundingRectangle.Intersects(Player.BoundingRectangle))
        {
            <span class="kwrd">if</span> (!player.TouchingEnemy)
                <span class="rem">//OnPlayerKilled(enemy);</span>
                OnPlayerInjured();
        }
        <span class="kwrd">else</span>
            UpdatePlayerCollision(<span class="kwrd">false</span>);
    }
}

<span class="kwrd">private</span> <span class="kwrd">void</span> UpdatePlayerCollision(<span class="kwrd">bool</span> touchingEnemy)
{
    player.TouchingEnemy = touchingEnemy;
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>That should be it. Save everything and run the game. You should see the health bar change every time you touch an enemy. You’ll have to advance to the second level to see one. After ten touches the character should die and you’ll be presented with a dialog. I haven’t changed the dialog or relevant code to restart the game, nor did I remove the sprite rendering the number of lives the player has. I wanted to keep the latter in so that the option to add a life power-up can be done without breaking the game. The former is something for you to implement. <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-smile.png" /></p>
<p>Hopefully someone will find this useful. </p>
<p>&#160;</p>
<p>Source code can be downloaded from <a href="http://machxgames.com/files/downloads/samples/PlatformerGSM_injuring.zip" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Crowd Funding the Future of Game Development?</title>
		<link>http://machxgames.com/blog/?p=104</link>
		<comments>http://machxgames.com/blog/?p=104#comments</comments>
		<pubDate>Thu, 09 Feb 2012 15:16:40 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Game Development Business]]></category>
		<category><![CDATA[Crowd Funding]]></category>
		<category><![CDATA[Double Fine]]></category>
		<category><![CDATA[Kickstarter]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=104</guid>
		<description><![CDATA[With Double Fine’s recently fully-funded (and then some) Kickstarter project leading the way (yes, I know there have been many other game development projects on Kickstarter, but none with the PR that this has received), we may start seeing a new way of doing game development, which would be a significant shift in the industry. [...]]]></description>
			<content:encoded><![CDATA[<p>With Double Fine’s recently fully-funded (and then some) <a href="http://www.kickstarter.com/projects/66710809/double-fine-adventure">Kickstarter project</a> leading the way (yes, I know there have been many other game development projects on Kickstarter, but none with the PR that this has received), we may start seeing a new way of doing game development, which would be a significant shift in the industry. This could eliminate publishers and allow studios to self-publish on any digital distribution system they want, Steam being the primary one of course.</p>
<p>The big question for me is, could this type of funding allow cancelled projects to be revived and, if so, would studios be able to do it, or allowed to do it depending on IP ownership. There are any number of cancelled projects that I’d love to see this happen for:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/The_Agency:_Covert_Ops">The Agency</a></li>
<li><a href="http://en.wikipedia.org/wiki/StarCraft:_Ghost">Starcraft: Ghost</a>&#160;</li>
<li><a href="http://en.wikipedia.org/wiki/Mythica">Mythica</a></li>
<li><a href="http://en.wikipedia.org/wiki/Category:Cancelled_video_games">Hundreds of other possibilities</a></li>
</ul>
<p>Instead of hiring additional personnel, studios could outsource the work to quality smaller studios or indie teams. This would allow these studios to continue to function while building a reputation for themselves. Of course, big name IP shouldn’t be the first games released this way until it’s proven that teams are capable of doing a quality job. </p>
<p>This could be a huge step in the evolution of game development and I hope to see more studios following Double Fine’s lead. I certainly would like to get some of my game ideas out there in the crowd funding arena. It could be the start of going full-time game dev.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=104</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>When will the next evolutionary step in MMOs come?</title>
		<link>http://machxgames.com/blog/?p=103</link>
		<comments>http://machxgames.com/blog/?p=103#comments</comments>
		<pubDate>Wed, 08 Feb 2012 20:56:16 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MMO]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=103</guid>
		<description><![CDATA[I was hoping for Star Wars: The Old Republic to be the next step in the evolution of MMOs. Imagine my disappointment after playing for a couple dozen hours to discover that it’s basically WoW reskinned. Sure, it’s got some things that are different and it’s cool to play as a Jedi, but at it’s [...]]]></description>
			<content:encoded><![CDATA[<p>I was hoping for Star Wars: The Old Republic to be the next step in the evolution of MMOs. Imagine my disappointment after playing for a couple dozen hours to discover that it’s basically WoW reskinned. <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-sadsmile1.png" /> Sure, it’s got some things that are different and it’s cool to play as a Jedi, but at it’s core there’s nothing really new here. Certainly nothing that I’m going to pay every month for when there are tons of great games sitting on my shelves from the past two Christmases waiting to be played.</p>
<p>I keep asking myself why hasn’t a company taken the MMO genre to the next level? Are they afraid of the risk? That’s a good possibility. Publishers aren’t going to fund a game that deviates too far from what’s sold in the past. But anything with the Star Wars label slapped on it usually sells (how many people are going to waste their money watching 3Dified versions of the Star Wars movies? You’re not going to find me doing so). So why didn’t Bioware and Lucas Arts make it the game it should have been instead of just playing it safe? Would it have cost too much? Perhaps, but according to what info I could find it’s already sold over 2M copies so I think it’s safe to say that it’s going to be making a good bit of money despite what it cost to develop. Surely they could have taken a bit more time up front to make it WoW++.</p>
<p>Tech is at a point, both hardware and software, where it seems that truly dynamic worlds are possible. Why should gamers be satisfied with areas where mobs respawn every couple of minutes. Talk about immersion breaking! Why should gamers be satisfied with assembly-line quests? How is it realistic that I can deliver the same letter to someone that thousands of others players have already delivered or rescue an NPC that’s been rescued already? Why is grinding still necessary to keep players player a game and thus giving the publisher more money? (A side question is why do players keep finding grinding fun and are willing to spend money to do so?)</p>
<p>So what would it take to move MMOs to the next level? A couple things off the top of my head:</p>
<p>1) A total redesign of the quest system – no more Fed-Ex or “Kill [x] [mob type]”. The “Rescue [NPC]” quest might still be valid, but only for the first person to complete it. After that anyone else that’s on the quest would have it removed from their quest log and it would never be available again (unless the NPC wandered off and was captured again). What’s that you say? “That’s not fair?” Who said it had to be fair? Why does every player (or class of players depending on the MMO) have to have the same quests available to them? “Because that’s the way it’s always been!” &lt; smack &gt; Stop thinking like that. We’re talking new and improved here.</p>
<p>What’s that leave us with then? Some of it depends on the MMO and what kinds of things can be done in the game world. Which ties in to the next thing:</p>
<p>2) A world that’s as alive as can be made. This would require a lot of work. Any NPC should be able to be killed. Period. If it’s important that an NPC stay alive, that NPC should be sufficiently protected, just like you would expect. This means that serious penalties should exist for random killing of people, just like you would expect. </p>
<p>Factions and reputation exist in most MMOs to some degree, but this reputation has to extend to areas around where an act a player commits warrants that reputation change. If a player kills an NPC and is seen or it’s discovered that the player was responsible, authorities in the surrounding areas should be made aware and kill/attempt to capture the player on sight. The penalties for being captured would have to be seriously examined, again depending on the game world of the MMO. Death penalty, confiscation of assets, incarceration (not being able to play for a period of time – yes I said that!), etc. are all possibilities.</p>
<p>A more alive world would feed back into the quest system as things happened. Quests would be dynamically created for certain events. What kind of things? Let’s consider:</p>
<ul>
<li>An NPC puts out a hit on another NPC for some reason</li>
<li>A player could offer a reward for rescuing their wife/husband/child that’s been kidnapped or captured by an enemy</li>
<li>An NPC wants to put a competitor out of business by having the player rough him up or destroy his business establishment</li>
<li>The Thieves Guild offers the player (who belongs to the Guild of course) an opportunity to steal something</li>
<li>An NPC hires the player to build or make him something (necessitating a good crafting system of course)</li>
<li>A king hires players as part of his army or a squad to wage war against a rival king.</li>
</ul>
<p>The possibilities are virtually limitless, depending on the effort the devs want to put into making the world as alive as possible.</p>
<p>2a) Part of this more alive world would have to be a real economy system, which means the loot system has to be completely overhauled. I’ve never understood how I could loot a huge sword off a dead animal or even a giant insect. What were the devs thinking?!?</p>
<p>2b) Money would have to be earned mainly through quests or crafting if the player wants to buy better equipment or other things like a house/land, if that’s an option. For a game I’m thinking about, the former would be provided and I’m not sure if the latter makes sense.</p>
<p>2c) Politics and intrigue could make the game more interesting. We’ve seen MMOs with different races combating one another before, but this could still be taken a step further. Assassinations, kidnappings, rescue attempts, espionage, full-on wars, etc. could all involve the players and lead to rewards, notoriety and fame, or even elevate the player to a position of influence in the world. </p>
<p>3) Players wouldn’t be able to cart around tons of loot, unless they were carrying bags of holding. If said bags of holding were so commonplace that every character could buy on, there’s a problem however. For non-fantasy/comic book world settings, this wouldn’t be a possibility anyway. Useful loot from creatures would be relatively rare, unless the creature itself is rare or parts of it can be used somehow (potions, spell components, etc.).</p>
<p>4) This would mean killing things just to gain experience would be revamped as it wouldn’t be as necessary nor mean as much. Yes, a player’s skill with weapons might increase from killing things, but this would be limited and caps would have to be put on how far a character’s skill can increase through repetition of the same activity.</p>
<p>5) Magic, combat, and skills are all usually fairly well done in MMOs for my taste, but I’d like to see magic at least affect the world more. Spells that cause plagues or result in famine across the land, massive spells of construction or destruction, etc. would make things a lot more interesting if a player was able to cast them. </p>
<p>Of course, this would be at max level capabilities, which mean not a lot of players should be able to reach that level. It should be more difficult than it is to max out your level. Players shouldn’t be able to power-level for a couple hours and reach it, nor should they be able to chew through content quickly. </p>
<p>Obviously a lot of this is going to alienate a lot of players, but hopefully a company would think it’s more important to advance the genre than just produce another WoW clone and suck as many players as possibly from other MMOs. The question is, what company is going to step up to the plate and take a swing? Hopefully someone will make the attempt soon. The genre can’t keep going as it has, at least not if they want me to play.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=103</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Perils of Coding on the Fly</title>
		<link>http://machxgames.com/blog/?p=100</link>
		<comments>http://machxgames.com/blog/?p=100#comments</comments>
		<pubDate>Fri, 03 Feb 2012 19:22:51 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Status Update]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=100</guid>
		<description><![CDATA[So I thought I could get the “character” editor for my game (you know, the only one I’m working on like a good developer! See the relevant “squirrel” post previously) up and running quickly. There’s not a lot of options to select from in creating a “character” in the game, so I figured it would [...]]]></description>
			<content:encoded><![CDATA[<p>So I thought I could get the “character” editor for my game (you know, the only one I’m working on like a good developer! See the relevant “squirrel” post previously) up and running quickly. There’s not a lot of options to select from in creating a “character” in the game, so I figured it would be a quick screen to whip up. I should have known better. <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-sadsmile.png" /></p>
<p>Usually, if a chunk of code isn’t that complicated I don’t take the time to make it object-oriented. Why do we use OOP methodologies anyway? For me it comes down to a couple of things:</p>
<ul>
<li>Ease of understanding</li>
<li>Ease of re-use</li>
<li>Ease of maintenance</li>
<li>Piecing chunks of code together is usually easier than writing one huge chunk of code (this ties in to the other three somewhat)</li>
</ul>
<p>For small, uncomplicated screens in a game (which I anticipated this being) usually none of these 4 things are lost if you code the screen in a non-OO manner. Menu screens in most games are a good example. There’s not much going on except detecting the selection of a menu item and moving to the next screen. An option screen isn’t that much harder &#8211; you just have to read and write out some data to a file to save the state of the options the player selects.</p>
<p>I wrongly believed the editor screen wouldn’t be much more difficult than a typical options screen. That’s come back to bite me.</p>
<p>The problem is mainly due to handling navigation between all the graphical elements on the screen that the player can select and drawing those elements with the option for each the player has selected. I’ve ended up with a bunch of variables for each object that obviously would be better suited to bundling up in a class and just having a list of each class object. I did this with the in-game level editor and it made it a lot easier. I don’t know why I figured I wouldn’t need it here. Oh, that’s right, I know why – I didn’t plan the screen out before I started coding. <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-embarrassedsmile" alt="Embarrassed smile" src="http://machxgames.com/blog/wp-content/uploads/2012/02/wlEmoticon-embarrassedsmile.png" /></p>
<p>Luckily ripping everything out and making it more OO shouldn’t be much more than a good night’s coding. I am thinking a bit beforehand about how I’ll do it though.</p>
<p>Lesson learned. Hopefully others will benefit from my mistake.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game Update and Other Stuff</title>
		<link>http://machxgames.com/blog/?p=96</link>
		<comments>http://machxgames.com/blog/?p=96#comments</comments>
		<pubDate>Wed, 01 Feb 2012 14:55:19 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Status Update]]></category>
		<category><![CDATA[DBP]]></category>
		<category><![CDATA[Dream Build Play]]></category>
		<category><![CDATA[game update]]></category>
		<category><![CDATA[Hero Engine]]></category>
		<category><![CDATA[IGDA]]></category>
		<category><![CDATA[spy game]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=96</guid>
		<description><![CDATA[Well, I didn’t quite get to where I wanted by the end of the month, but at least I made progress. The level editor is mostly done, although not fully tested. The “character” editor is probably 50% done. The plan is to get it completed for the next Dream Build Play, which I think is [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I didn’t quite get to where I wanted by the end of the month, but at least I made progress. The level editor is mostly done, although not fully tested. The “character” editor is probably 50% done. The plan is to get it completed for the next Dream Build Play, which I think is quite doable.</p>
<p>The squirrel did attack (see my previous post) and I opened up The Agency project when I realized the tileset I was using wasn’t going to work for all situations. I also took another look at <a href="http://www.heroengine.com/">Hero Engine</a> to see how easy it was to work with. There’s a cute little bunny farming world that they set up to show how some things are done (quests, menus, area picking, etc.). I would need to read a lot more of the documentation to find out if it’s a truly viable solution for a spy game like I’ve been fooling around with, especially since it would be just me working on it at the moment.</p>
<p>A huge (to me at least) thing that’s happened since my last post is that I’m waiting for a phone interview to be set up with an actual game studio. I keep an eye out every once in a while for positions at various companies just to see how the industry is going and I happened to see positions for which I’m actually qualified! That’s extremely rare since I don’t do C++ anymore. I sent in my resume for a couple of positions and got a reply back from one. I’m hoping to hear back from the other as well but we’ll see. This would be life changing in that I’d have to move, but given my current job instability I’d have to seriously consider uprooting the family if they make me an offer that’s enough to support us, especially since it’s the opportunity of a lifetime. At least I’d have the hope of some potential for growth there. I’m slowly digging myself into a hole at my current job as we’re nowhere near current with technology.</p>
<p>I was excited to see that the local chapter of the <a href="http://www.igda.org/">IGDA</a> is starting back up with a meeting Thursday. If you’re in the Baltimore area, come out and join in – 7 p.m. at The Green Turtle in Hunt Valley. There’s a ton of talent in the area and past meetings have been pretty awesome so I’m hoping for good stuff this year.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=96</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another year, another restart :(</title>
		<link>http://machxgames.com/blog/?p=94</link>
		<comments>http://machxgames.com/blog/?p=94#comments</comments>
		<pubDate>Mon, 09 Jan 2012 18:03:22 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[XBLIG]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=94</guid>
		<description><![CDATA[Well, not a complete restart at least. What I have decided to do, is attempt to focus on and complete one game before moving on to another.&#160; I’ve been fighting the “squirrel” battle for a long time, but I’m hoping to overcome it this year (just in time for the world to end, I know). [...]]]></description>
			<content:encoded><![CDATA[<p>Well, not a complete restart at least.</p>
<p>What I <em>have</em> decided to do, is attempt to focus on and complete one game before moving on to another.&#160; I’ve been fighting the “squirrel” battle for a long time, but I’m hoping to overcome it this year (just in time for the world to end, I know).</p>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:f4d3c14d-0c9d-41fb-b1b1-618c7c7dcef1" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/YaAxzIFgNso&amp;hl=en"></param><embed src="http://www.youtube.com/v/YaAxzIFgNso&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
<p>&#160;</p>
<p>I’m digging up an old game that I’d started a number of times but put on the back burner since it’s a fairly big game, at least from the number of features I’m planning. I’m planning on releasing it on XBLIG (why I still haven’t figure out given it’s a virtual graveyard that’s to the mismanagement and/or uncaring of MS <img src='http://machxgames.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ) and then probably IndieCity or possibly Steam if I’m lucky. WP7 is a dream, but I’m not sure how well it would do on that platform. If I can get enough done for the next DreamBuildPlay, so much the better.</p>
<p>The short list of significant features I’m planning on:</p>
<ul>
<li>In-game level editor</li>
<li>Level sharing</li>
<li>“Global” leaderboards</li>
<li>In-game (and possibly out-of-game for the PC version) “store” for players to upgrade their “character”</li>
<li>6 player multiplayer</li>
<li>Single player with AI</li>
</ul>
<p>I’m hoping this game will be my ticket to indie game developer freedom so I can ditch the boring (although fairly well-paying) day job. I’m not holding my breath though. If I can make a decent chunk of money I’ll be happy.</p>
<p>I probably won’t share any more details about the actual game until it’s ready for playtest. I will be posting status updates here though for the 1 person that actually might follow this blog. <img src='http://machxgames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>On a personal note, I did receive my MVP award again my contributions to the tech for last year. That’s 6 years in a row for anyone counting. I’m not sure how much longer I’ll be able to maintain it with XNA slowly dying however. I guess I’ll just keep chugging away and see what happens.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=94</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Thoughts on the new XBLIG changes</title>
		<link>http://machxgames.com/blog/?p=91</link>
		<comments>http://machxgames.com/blog/?p=91#comments</comments>
		<pubDate>Thu, 05 Jan 2012 15:26:58 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[XBLIG]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=91</guid>
		<description><![CDATA[So XBLIG isn’t dead after all it seems. MS rolled out a couple of changes yesterday to the submission policy that has some people cheering and some people wondering why they even bothered (raises hand). I can’t figure out who is running things there these days. This has to be one of the biggest wastes [...]]]></description>
			<content:encoded><![CDATA[<p>So XBLIG isn’t dead after all it seems. MS rolled out <a href="http://blogs.msdn.com/b/xna/archive/2012/01/04/happy-new-year-xbox-live-indie-games.aspx">a couple of changes</a> yesterday to the submission policy that has some people cheering and some people wondering why they even bothered (raises hand).</p>
<p>I can’t figure out who is running things there these days. This has to be one of the biggest wastes of time I’ve seen in a while for XBLIG. Maybe I’m missing the point, but letting developers upload bigger games and giving them more slots when the system is so broken as to be virtually useless seems absurd. The main list that users browse through to find games locks up every other week it seems, which makes submitting a game frustrating since you never know if your game will even be viewable when it passes peer review. That’s assuming people even find XBLIG in the first place with the <a href="http://www.shacknews.com/article/71691/xbox-360-dashboard-lampooned-in-game-type-for-xblig">insane tile</a> used to access it and other games.</p>
<p>These changes feel like MS is throwing XBLIG devs a PR bone to get them to feel good about the service. It’s not even a meaty bone through; it’s dried up and weeks old. I get that doing this doesn’t really require any significant changes to XNA GS or the App Hub, but good grief, why not fix the existing bugs first before changing things?!?</p>
<p>I guess with the increase in submission size we can now expect massagers and zombie rip-off clones packed full of more useless crap. Like I need an app that vibrates the controller while listening to a couple hundred MBs of soundtracks or hi-res textures pasted on top of a crappy games.</p>
<p>I’ve just about given up on XBLIG. Unless MS does something significant to make the service attractive to devs and stop them from jumping ship to Steam and non-WP7 mobile platforms I can’t see it lasting much longer.</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Post About XBLIG crApps</title>
		<link>http://machxgames.com/blog/?p=90</link>
		<comments>http://machxgames.com/blog/?p=90#comments</comments>
		<pubDate>Fri, 23 Dec 2011 13:55:33 +0000</pubDate>
		<dc:creator>Mach X Games</dc:creator>
				<category><![CDATA[XBLIG]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[crApps]]></category>

		<guid isPermaLink="false">http://machxgames.com/blog/?p=90</guid>
		<description><![CDATA[Following the link in a review begging tweet on #xna I saw the following in the Notes of an XBLIG peer review submission: “Here&#8217;s a quick and dirty Santa flying game I threw together.” Time to put on the Grinch costume and respond I guess. While I realize that holiday themed games usually do a [...]]]></description>
			<content:encoded><![CDATA[<p>Following the link in a review begging tweet on #xna I saw the following in the Notes of an XBLIG peer review submission:</p>
<p>“Here&#8217;s a quick and dirty Santa flying game I threw together.”</p>
<p>Time to put on the Grinch costume and respond I guess.</p>
<p>While I realize that holiday themed games usually do a little better on XBLIG, if you don’t care enough to take enough pride in your work to do a quality job why should I care enough to review the game? Yes, you might make a few bucks on the game due to holiday theme-ness, but is it really worth it in the long run?</p>
<p>What’s truly unfortunate is that there are enough crApp developers that games like this get passed with relative ease. If I or other developers that really care about the platform can’t find a reason to fail these crApps, there’s little we can do to stop them from passing. This is the downside to Microsoft “democratizing game development”; they obviously didn’t expect, or didn’t care about, people submitting things like flashlight apps, massager “games”, games that take 2 minutes to play through and don’t have any replay value, etc., ad nauseum.</p>
<p>Hopefully other devs that care about the platform will do the same and pass on submissions like this. Maybe I need to start an Occupy XBLIG! :\</p>
]]></content:encoded>
			<wfw:commentRss>http://machxgames.com/blog/?feed=rss2&#038;p=90</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

