<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>Borne Games Forum &#187; Tag: detection - Recent Posts</title>
		<link>http://www.bornegames.com/forum/tags/detection</link>
		<description>Borne Games Forum &#187; Tag: detection - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Feb 2012 23:47:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://www.bornegames.com/forum/rss/tags/detection" rel="self" type="application/rss+xml" />

		<item>
			<title>kstyle on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68647</link>
			<pubDate>Thu, 26 Aug 2010 02:38:55 +0000</pubDate>
			<dc:creator>kstyle</dc:creator>
			<guid isPermaLink="false">68647@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>If I am clear on the purpose of the !hitTest while loop, it is for fixing the overshoot of the character after you moved him out of the ground right? If so, then why do you need to run it at all unless you detected a collision before it?</p>
<p>if(char.hitTest(ground)) {<br />
char._y --;<br />
while(char.hitTest(ground)) {<br />
char._y --;<br />
}<br />
while(!char.hitTest(ground)) {<br />
char._y++;<br />
}<br />
}
</p>]]></description>
					</item>
		<item>
			<title>VideoGuy on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68571</link>
			<pubDate>Wed, 25 Aug 2010 01:35:16 +0000</pubDate>
			<dc:creator>VideoGuy</dc:creator>
			<guid isPermaLink="false">68571@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>But...why would a for loop be any different? Unless I&#39;m confused about how you have the loop set up.
</p>]]></description>
					</item>
		<item>
			<title>DrNeroCF on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68570</link>
			<pubDate>Wed, 25 Aug 2010 01:17:41 +0000</pubDate>
			<dc:creator>DrNeroCF</dc:creator>
			<guid isPermaLink="false">68570@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<blockquote><p>I assume you&#39;re running a while (!hitTestPoint) on the ground for both of the dots, right? When there&#39;s no ground underneath to hitTest, it just runs the loop to infinity. I think you could put&#60;&#62;<br />
<code>&#60;&#62;<br />
if (char.y &#62; 1000) { break; }&#60;&#62;<br />
</code>&#60;&#62;<br />
right after the beginning of the while loop to prevent it. Then again it wouldn&#39;t fix anything, just prevent a complete crash.</p>
</blockquote>
<p>Well, no, then your char will just be warping downwards indefinitely.  Use a for loop instead of a while loop (never use whiles on anything that&#39;s !hitTest).
</p>]]></description>
					</item>
		<item>
			<title>DrNeroCF on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68569</link>
			<pubDate>Wed, 25 Aug 2010 01:13:12 +0000</pubDate>
			<dc:creator>DrNeroCF</dc:creator>
			<guid isPermaLink="false">68569@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>_x += speed * Math.sin((_rotation)*(Math.PI/180))<br />
_y += -speed * Math.cos((_rotation)*(Math.PI/180))</p>
<p>Use this to fix those extreme angles.  Instead of adding &#39;speed&#39; to _x, use this to add &#39;speed&#39; to both, depending on the angle.
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68560</link>
			<pubDate>Tue, 24 Aug 2010 20:11:26 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68560@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>like i said, ill fix it for the eral version, this i sjust getting the engine up and running
</p>]]></description>
					</item>
		<item>
			<title>WJUK on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68555</link>
			<pubDate>Tue, 24 Aug 2010 19:28:45 +0000</pubDate>
			<dc:creator>WJUK</dc:creator>
			<guid isPermaLink="false">68555@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Can&#39;t you arbitrarily put a limit down (so if it collides with that, it stops)?
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68542</link>
			<pubDate>Tue, 24 Aug 2010 16:36:31 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68542@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>its not the player thats the problem, its the points, but thats not much of a problem, its easily fixed, i just dont need to yet.
</p>]]></description>
					</item>
		<item>
			<title>VideoGuy on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68541</link>
			<pubDate>Tue, 24 Aug 2010 16:31:27 +0000</pubDate>
			<dc:creator>VideoGuy</dc:creator>
			<guid isPermaLink="false">68541@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>I assume you&#39;re running a while (!hitTestPoint) on the ground for both of the dots, right? When there&#39;s no ground underneath to hitTest, it just runs the loop to infinity. I think you could put<br />
<code><br />
if (char.y &#62; 1000) { break; }<br />
</code><br />
right after the beginning of the while loop to prevent it. Then again it wouldn&#39;t fix anything, just prevent a complete crash.
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68539</link>
			<pubDate>Tue, 24 Aug 2010 16:22:24 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68539@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>yeah, im pretty sure it has to do with the dots falling into nothingness... maybe ill put a muffin down there so they dont act like wusses and try to crash flash...<br />
and thanks  <img src='http://www.bornegames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  all ive got for the game is the main character. i think for the setting it should be something suburban or urban... also if anyone wants the code or fla file just ask, reason im not posting it right now is cause i dont want some random person using it in their game without asking/credting.
</p>]]></description>
					</item>
		<item>
			<title>VideoGuy on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way/page/2#post-68537</link>
			<pubDate>Tue, 24 Aug 2010 16:17:57 +0000</pubDate>
			<dc:creator>VideoGuy</dc:creator>
			<guid isPermaLink="false">68537@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<blockquote><p>i still need to fix going up really fast for steep hills (also for the example, dont go off the edge, it screws flash up, just warning you)</p></blockquote>
<p>I should have really read that before playing.</p>
<p>But seriously, it looks pretty good. I can&#39;t wait to see where you take that engine from here.
</p>]]></description>
					</item>
		<item>
			<title>WJUK on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68530</link>
			<pubDate>Tue, 24 Aug 2010 15:40:08 +0000</pubDate>
			<dc:creator>WJUK</dc:creator>
			<guid isPermaLink="false">68530@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Sounds like you&#39;ve got it figured out.  Probably not quite as smooth as doing it the traditional way, but it&#39;s probably easier.</p>
<p>Also, you should fix the crash when you move to the extreme edges.
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68523</link>
			<pubDate>Tue, 24 Aug 2010 14:27:21 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68523@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>hey, i found out a really easy way to jump in a certain direction.<br />
<a href="http://www.newgrounds.com/dump/item/555d11c27a7212ea55d6809f8c4ff514" rel="nofollow">http://www.newgrounds.com/dump/item/555d11c27a7212ea55d6809f8c4ff514</a><br />
i still need to fix going up really fast for steep hills (also for the example, dont go off the edge, it screws flash up, just warning you) but for now, its pretty good. especially considering this is the first game im ever making with flash. oh and thanks for anybody who gave any input or helped in any way.  <img src='http://www.bornegames.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68458</link>
			<pubDate>Mon, 23 Aug 2010 19:28:10 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68458@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>well, i tried out the code in the link, and its really not that good... i got it to jump and do gravity with the code i got originally, and i got it so that there arent as many &#34;whiles&#34; so i think ill stick with that code. but now, im probably gonna work on making it so that it only rotates when its on the ground, but ill do that tommorow or so... right now, i did my coding for the day, at this rate i should have it done right before 2012, that way people will get to play it right before they die  <img src='http://www.bornegames.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> 
</p>]]></description>
					</item>
		<item>
			<title>kstyle on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68448</link>
			<pubDate>Mon, 23 Aug 2010 18:24:07 +0000</pubDate>
			<dc:creator>kstyle</dc:creator>
			<guid isPermaLink="false">68448@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>I don&#39;t have a working .fla because I do it a completely different way that&#39;s much more math intensive, but if you look around the link I posted you&#39;ll find a working .fla and some code, which should work with your setup with little extra work. He actually does it sort of in reverse order to what I told you, colliding the character clip first, then adjusting the two points on either side of the character. This eliminates the need for a specific distance set up.</p>
<p>But, it&#39;s always good to know how to do it. So I&#39;ll explain the concept and you can apply it yourself in code.</p>
<p>First thing you need to do is apply the distance formula between the two points (character&#39;s &#34;feet&#34; ) and determine how far apart they actually are. Sqrt((x2-x1)^2+(y2-y1)^2) where (x1,y1) is the first pt, and (x2,y2)is the second pt. Subtract how far they are supposed to be from this number, then move each point by half of the extra distance.
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68443</link>
			<pubDate>Mon, 23 Aug 2010 17:24:08 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68443@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>oh, yeah i guess youre right. 6 whiles is probably what gave me so many problems. but could you give me an example of this (in fla format, if possible for flash 8 please) i sorta get what youre talking about, but im having trouble with keeping them the same distance apart, what do you do for that? sorry if this seems annoying or anything, i just really want to get this part done so i can move onto the other parts of the game.
</p>]]></description>
					</item>
		<item>
			<title>kstyle on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68440</link>
			<pubDate>Mon, 23 Aug 2010 16:33:51 +0000</pubDate>
			<dc:creator>kstyle</dc:creator>
			<guid isPermaLink="false">68440@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>I&#39;m not sure exactly what you&#39;re doing, but it doesn&#39;t seem like your slope detection method works quite right. The character jitters a lot, and whenever you go up a steep slope, the character moves really fast to the other end. I glanced at your code and you are running 6 while loops a frame, which is kind of ridiculous. The simplest way to achieve what you&#39;re trying to do would probably be the way I think most people on this forum do it: simply treat each of the two points separately, applying movement and gravity to each, then use a single while loop each to bring them out of the ground, then bind them together by moving each of them so that they are always the same distance apart (which will prevent your character from suddenly moving really fast). Calculate rotation as you are right now, then average the points to find where to draw your player. </p>
<p>here is an implementation similar to what I&#39;m talking about. <a href="https://www.mochimedia.com/community/forum/topic/slope-detection" rel="nofollow">https://www.mochimedia.com/community/forum/topic/slope-detection</a>
</p>]]></description>
					</item>
		<item>
			<title>WJUK on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68434</link>
			<pubDate>Mon, 23 Aug 2010 15:31:49 +0000</pubDate>
			<dc:creator>WJUK</dc:creator>
			<guid isPermaLink="false">68434@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>How about do the jumping with trig?</p>
<p>Since you know the position (coordinates) of the two points you use for slope detection, surely you can just detect the angle they make and apply the correct x and y coefficients to generate thrust for jumping.</p>
<p>If you apply the x,y thrust over time, you can also simulate gravity by letting the y thrust peter out until it&#39;s 0 then start going negative (obviously you should also apply a terminal velocity, otherwise you&#39;ll shoot through platforms).  Then stop apply y thrust immediately when you detect a hit with a platform.
</p>]]></description>
					</item>
		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68423</link>
			<pubDate>Mon, 23 Aug 2010 14:23:16 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68423@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>its ironic, i got the supposedly hard part down (slope detection) an i cant get something easy like gravtity and jumping
</p>]]></description>
					</item>
		<item>
			<title>WJUK on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68420</link>
			<pubDate>Mon, 23 Aug 2010 12:19:16 +0000</pubDate>
			<dc:creator>WJUK</dc:creator>
			<guid isPermaLink="false">68420@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>I suppose so, but it might look a bit weird to jump off areas that are slanted when you&#39;re jumping directly up.
</p>]]></description>
					</item>
		<item>
			<title>Nyubis on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68416</link>
			<pubDate>Mon, 23 Aug 2010 09:07:35 +0000</pubDate>
			<dc:creator>Nyubis</dc:creator>
			<guid isPermaLink="false">68416@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Yeah, that&#39;s what I meant.
</p>]]></description>
					</item>

	</channel>
</rss>

