<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>My New Game!</title>
		<link>http://www.allegro.cc/forums/view/615233</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 30 Mar 2015 20:26:47 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi all,</p><p>Here&#39;s my first finished game (well, as finished as it&#39;s likely to get. We&#39;ll see, I will most likely move on from here). It&#39;s called ArkaNerd after the famous arcade game Arkanoid. You will need a joystick or joypad with a digital D-pad in order to play this (I&#39;ve decided not to support analog sticks at this time in favor of the digital pad&#39;s ease of use). The game is over if you lose 3 balls or break all 60 bricks. Any feedback is greatly appreciated. The file is a compressed RAR file, just extract it to any directory and it should work fine. If you&#39;d like to see the code I can post it here too. Remember this game is mostly just practice, so I can only go up from here.</p><p>Have fun!</p><p>P.S. I am using a Logitech Dual Action joypad without any problems but your mileage may vary. If you have an XBox-compatible pad with 2 analog sticks and a digital D-Pad you should be fine. If you have problems, let me know and I&#39;ll see if I can&#39;t tweak the code for you.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (agonvs)</author>
		<pubDate>Mon, 30 Mar 2015 08:59:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Crashes as soon as I launch it <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>NULL pointer problem. eg, something is returning NULL and you are not handling that case.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 30 Mar 2015 09:07:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can&#39;t imagine what would be causing the error short of an incompatible joystick. Not that I doubt it would make much difference, but is your system 64-bit or 32-bit? I built this thing on a 64-bit rig. Try this updated version. Here&#39;s the code for it too if you want to build it on your own platform. Just remember to keep all these files in the same directory and set it to your target directory.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (agonvs)</author>
		<pubDate>Mon, 30 Mar 2015 09:46:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I also get a crash. It seems that it&#39;s because I don&#39;t have the correct libstdc++-6.dll. Looking at the Allegro DLL I notice you included the MD version, which, according to the installation guide:</p><div class="quote_container"><div class="title"><a href="https://www.allegro.cc/manual/5/install/windows.html">installation guide</a> said:</div><div class="quote"><p>
These options affect how the compiler links to the standard C library. The MT version includes it as part of the executable. The MD version leaves it out, and requires you to also include the appropriate system DLLs when you distribute your program.
</p></div></div><p>

So, you have two options, either keep using the MD version and include the appropriate libstdc++-6.dll when you distribute your game or use the MT version and avoid this problem. Below is a screen of the crash dialog.</p><div class="spoiler"><p>
<span class="remote-thumbnail"><span class="json">{"name":"609353","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/6\/16f3c12011f123d227cbd1e71361ca5e.png","w":496,"h":171,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/6\/16f3c12011f123d227cbd1e71361ca5e"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/1/6/16f3c12011f123d227cbd1e71361ca5e-240.jpg" alt="609353" width="240" height="82" /></span>
</p></div><p>

EDIT:</p><p>After this:</p><div class="source-code snippet"><div class="inner"><pre>    <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_install_joystick"><span class="a">al_install_joystick</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span>
      cout <span class="k3">&lt;</span><span class="k3">&lt;</span> <span class="s">"Couldn't install joystick."</span> <span class="k3">&lt;</span><span class="k3">&lt;</span> endl<span class="k2">;</span>
</pre></div></div><p>

You should probably add something like this:</p><div class="source-code snippet"><div class="inner"><pre>    <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_num_joysticks"><span class="a">al_get_num_joysticks</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
        cout <span class="k3">&lt;</span><span class="k3">&lt;</span> <span class="s">"No joysticks detected. Sorry sucka!"</span> <span class="k3">&lt;</span><span class="k3">&lt;</span> endl<span class="k2">;</span>
        <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
    <span class="k2">}</span>
</pre></div></div><p>

So that the program exits gracefully if no joysticks are present instead of crashing horribly.</p><p>Alternatively, if you&#39;re in the geeky mood, just detect whether a joystick is present and if it&#39;s not, you could maybe fall back to keyboard controls? That way there would be no crashes. </p><p>EDIT2:</p><p><a href="https://www.allegro.cc/files/attachment/609355">This version</a> should work regardless of whether you have a joystick or not. I also attached the <span class="source-code">main2.cpp</span> file with all the changes I did. You can view the differences <a href="https://www.diffchecker.com/hp8tdjbi">here</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 30 Mar 2015 12:40:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Vanneto&#39;s version works for me <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 30 Mar 2015 19:07:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Vanetto&#39;s fix works on mine too. The game works well with my Logitech F310 game pad. Good stuff agonvs
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (devo_au)</author>
		<pubDate>Mon, 30 Mar 2015 20:02:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow! Thanks for all your great help and feedback. I really appreciate it <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /> Also, if you have any ideas for simple games you&#39;d like to see, let me know and if it&#39;s not too difficult I&#39;ll have a crack at it <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (agonvs)</author>
		<pubDate>Mon, 30 Mar 2015 20:09:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Got any screen shots?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (StevenVI)</author>
		<pubDate>Mon, 30 Mar 2015 20:22:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here&#39;s a screen capture (I am using dual monitors. The game is on the left).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (agonvs)</author>
		<pubDate>Mon, 30 Mar 2015 20:26:47 +0000</pubDate>
	</item>
</rss>
