<?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>Ludum Dare &#187; aiming</title>
	<atom:link href="http://www.ludumdare.com/compo/tag/aiming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ludumdare.com/compo</link>
	<description>A tri-annual 48 hour solo game development competition.</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:14:06 +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>Re: Distractions Deluxe</title>
		<link>http://www.ludumdare.com/compo/2008/04/19/re-distractions-deluxe/</link>
		<comments>http://www.ludumdare.com/compo/2008/04/19/re-distractions-deluxe/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 21:14:21 +0000</pubDate>
		<dc:creator>LunarCrisis</dc:creator>
				<category><![CDATA[LD #11 - Minimalist - 2008]]></category>
		<category><![CDATA[aiming]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[bullets]]></category>
		<category><![CDATA[distractions]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://www.ludumdare.com/compo/2008/04/19/re-distractions-deluxe/</guid>
		<description><![CDATA[My solution: So the problem is to figure out the direction a player (moving in 3-d) has to shoot to hit an enemy (also moving in 3-d) given their positions, velocities, and the speed of the bullet. The approach I used was to solve the equation time it takes the enemy to reach a position [...]]]></description>
			<content:encoded><![CDATA[<p>My solution:</p>
<p>So the problem is to figure out the direction a player (moving in 3-d) has to shoot to hit an enemy (also moving in 3-d) given their positions, velocities, and the speed of the bullet.</p>
<p>The approach I used was to solve the equation</p>
<blockquote><p>time it takes the enemy to reach a position = time it takes the bullet to reach the position</p></blockquote>
<p>for the time.</p>
<p>First, redefine the vectors so that they are all relative to the player. This<br />
leaves you with only bullet speed, enemy velocity, and enemy position. The<br />
points in question are the points along the enemy&#8217;s trajectory, so express the<br />
above equation in terms of t:</p>
<p><a href="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/b1.png" title="b1.png"><img src="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/b1.png" alt="b1.png" /></a></p>
<p>This can be solved with the quadratic equation:</p>
<p><a href="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/b21.png" title="b21.png"><img src="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/b21.png" alt="b21.png" /></a></p>
<p>Note that there may be zero, one, or two solutions. Negative solutions reflect hits in the past. If there are no positive solutions it is not possible for the player to hit the enemy.</p>
<p>Once you have t, it is simple to calculate the position.</p>
<p>Edit: forgot the exponent on the bottom of the final answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludumdare.com/compo/2008/04/19/re-distractions-deluxe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Distractions Deluxe</title>
		<link>http://www.ludumdare.com/compo/2008/04/19/distractions-deluxe/</link>
		<comments>http://www.ludumdare.com/compo/2008/04/19/distractions-deluxe/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 20:45:39 +0000</pubDate>
		<dc:creator>DrPetter</dc:creator>
				<category><![CDATA[LD #11 - Minimalist - 2008]]></category>
		<category><![CDATA[aiming]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[bullets]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://www.ludumdare.com/compo/2008/04/19/distractions-deluxe/</guid>
		<description><![CDATA[Someone (partly me) derailed the IRC into wild discussion of a math problem. I think some 5-6 people were involved at some points, and we still haven&#8217;t arrived at a conclusion as far as I can tell. Here&#8217;s an image I cooked up to help visualize the problem: The problem is deceptively simple: Determine what [...]]]></description>
			<content:encoded><![CDATA[<p>Someone (partly me) derailed the IRC into wild discussion of a math problem. I think some 5-6 people were involved at some points, and we still haven&#8217;t arrived at a conclusion as far as I can tell.</p>
<p>Here&#8217;s an image I cooked up to help visualize the problem:</p>
<p><a href="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/salvation.jpg" title="salvation.jpg"><img src="http://www.ludumdare.com/compo/wp-content/uploads/2008/04/salvation.thumbnail.jpg" alt="salvation.jpg" /></a></p>
<p>The problem is deceptively simple: Determine what angle to fire a bullet in, if it is to hit a target that&#8217;s moving past you at a constant velocity. In other words, both objects are moving at a fixed speed, and you just have to figure out in what direction to launch the bullet so that it&#8217;ll hit the target perfectly. Iterative solutions need not apply. Good luck with interpreting the image, it&#8217;s pretty confus(ed/ing).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludumdare.com/compo/2008/04/19/distractions-deluxe/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

