<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Using keyboard all over the place</title>
		<link>http://www.allegro.cc/forums/view/612843</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 25 Jun 2013 16:35:54 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am currently doing collision ,and I need to chechk if any of keys on keyboard is  pressed at that moment ( bassicly , if it is I stop chechking my collision since I dont know better way to handle my collision) , but since this part of code is out of &quot;main&quot; I cant use those &quot; keys[RIGHT]&quot; variables if I can call them that way. Could anyone give me better solution then making one global boolean variable to chechk this .
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kebapmanager)</author>
		<pubDate>Sun, 23 Jun 2013 01:51:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can get the keyboard status at anytime. Are you using Allegro 4 or 5?</p><div class="source-code snippet"><div class="inner"><pre><span class="c">//In allegro 4, </span>
<span class="k1">if</span> <span class="k2">(</span> <a href="http://www.allegro.cc/manual/key"><span class="a">key</span></a><span class="k2">[</span> ... <span class="k2">]</span> <span class="k2">)</span> ...

<span class="c">//In allegro 5</span>
<a href="http://www.allegro.cc/manual/ALLEGRO_KEYBOARD_STATE"><span class="a">ALLEGRO_KEYBOARD_STATE</span></a> kbdstate<span class="k2">;</span>

<a href="http://www.allegro.cc/manual/al_get_keyboard_state"><span class="a">al_get_keyboard_state</span></a><span class="k2">(</span> <span class="k3">&amp;</span>kbdstate <span class="k2">)</span><span class="k2">;</span>

<span class="k1">if</span> <span class="k2">(</span> <a href="http://www.allegro.cc/manual/al_key_down"><span class="a">al_key_down</span></a><span class="k2">(</span> <span class="k3">&amp;</span>kbdstate, ... <span class="k2">)</span> <span class="k2">)</span> ...
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Sun, 23 Jun 2013 02:04:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see no good reason to depend on the user input while handling collisions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (l j)</author>
		<pubDate>Sun, 23 Jun 2013 02:11:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am using allegro 5 , tnx for that it was really dumb for me , but I forgot that was possible ...</p><p>Yes I know its really dumb to make your collision keyboard dependete , but I ahd huge issues on handling collision , like I dont know what to do once collision is detected , so I just started using some random things , and I got it working .... ( I am not satisfied with is , but after a month of trying to get it work properly ,I dont even care anymore ... just to have it working .. :/ )
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kebapmanager)</author>
		<pubDate>Sun, 23 Jun 2013 02:31:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just keep track of the direction your entity is moving or the previous position. That ought to help resolving collisions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (l j)</author>
		<pubDate>Sun, 23 Jun 2013 02:52:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes I know  , but Wht should I do when collision happens? , set speed to 0 ? or just set players cordinates?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kebapmanager)</author>
		<pubDate>Sun, 23 Jun 2013 18:03:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/612843/985531#target">kebapmanager</a> said:</div><div class="quote"><p> but Wht should I do when collision happens? , set speed to 0 ? or just set players cordinates?</p></div></div><p>We can&#39;t answer that question because we don&#39;t know what sort of collision detection you are doing, or what you are trying to achieve.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 23 Jun 2013 18:06:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well its just simple super mario stlye collision , its a platformer game so you get the idea what I want :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kebapmanager)</author>
		<pubDate>Tue, 25 Jun 2013 16:16:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s an involved process to explain how to program mario style collisions, even though it&#39;s relatively simple.</p><p>I suggest you read a tutorial like <a href="http://www.tonypa.pri.ee/tbw/start.html">this one</a>. It&#39;s written for flash, but the logic remains the same.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ph03nix)</author>
		<pubDate>Tue, 25 Jun 2013 16:35:54 +0000</pubDate>
	</item>
</rss>
