<?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 Topics</title>
		<link>http://www.bornegames.com/forum/tags/detection</link>
		<description>Borne Games Forum &#187; Tag: detection - Recent Topics</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Feb 2012 15:48:33 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://www.bornegames.com/forum/rss/tags/detection/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>Shadow Gamer1 on "slope detection - easy way"</title>
			<link>http://www.bornegames.com/forum/topic/slope-detection-easy-way#post-68323</link>
			<pubDate>Sat, 21 Aug 2010 13:14:09 +0000</pubDate>
			<dc:creator>Shadow Gamer1</dc:creator>
			<guid isPermaLink="false">68323@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>well, after seeing the amount of math used in the codes posted here, i figured i was never gonna be able to figure it out, but i specialize in making stuff easier then it really is. so i figured this, what if i used thee same type of code used in a frame slider to make sure the two circles needed to rotate the character are the right distance away, and rotate at the same time and stuff, ill work on the code ill need, but it would help if someone that had experience with this type of stuff could help, such as making the line in between rotate as the two circles do. this is just a suggestion, but it could sure help a lot of people if it worked, and make it a whole lot easier than learning trig.</p>
<p>EDIT: k, ive got the circle slider thing ready, here ill show you<br />
<a href="http://www.newgrounds.com/dump/item/62558dcd6321bb0e52ab54b46f28c14f" rel="nofollow">http://www.newgrounds.com/dump/item/62558dcd6321bb0e52ab54b46f28c14f</a><br />
now, all i need to do is make two circles, and make sure theyre always the same distance apart, ive got a couple ideas, but im not sure if theyll work.
</p>]]></description>
					</item>
		<item>
			<title>Frozoth on "Slope Rotation - Need Help!!!"</title>
			<link>http://www.bornegames.com/forum/topic/slope-rotation-need-help#post-19766</link>
			<pubDate>Fri, 01 May 2009 00:07:56 +0000</pubDate>
			<dc:creator>Frozoth</dc:creator>
			<guid isPermaLink="false">19766@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Hey, guys. I'm pretty new here, and the main reason I joined (aside from loving FPA) is that I'm also pretty new to flash. I've made a sort-of working slope detection game, but I'm trouble getting the character, in this case a stick, to rotate SMOOTHLY according to what the angle of the two points around him are at.</p>
<p>If that's not specific enough, just ask what info you need.
</p>]]></description>
					</item>
		<item>
			<title>TheKomputerGeek on "AS3 Slope Tutorial"</title>
			<link>http://www.bornegames.com/forum/topic/as3-slope-tutorial#post-53316</link>
			<pubDate>Sat, 13 Mar 2010 15:43:29 +0000</pubDate>
			<dc:creator>TheKomputerGeek</dc:creator>
			<guid isPermaLink="false">53316@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Does anyone have a as3 slope detection tutorial? I&#39;ve been trying to find one for almost a month, and I still haven&#39;t had any luck...
</p>]]></description>
					</item>
		<item>
			<title>Thefox on "Basic Slope Detection Tutorial"</title>
			<link>http://www.bornegames.com/forum/topic/basic-slope-detection-tutorial#post-40236</link>
			<pubDate>Fri, 16 Oct 2009 19:07:06 +0000</pubDate>
			<dc:creator>Thefox</dc:creator>
			<guid isPermaLink="false">40236@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Hey all sorry for the wait. This week has been really busy with all my projects and school. But here is the tutorial:</p>
<p>In this tutorial I will teach you how to build a basic slope engine. Please take note that this slope engine will NOT work on slopes with an angle greater than 90 degrees.</p>
<p>For this tutorial I will assume you know how to make a character move on flat ground in flash. </p>
<p>So before we begin you will need a bit of knowledge in trigonometry (I will refer to this as trig from now on). Trig is all about the realtionships between the angles and sides in a triangle. Thus using trig you are able to find the angle between sides of a triangle, or the length of the sides based on the angle. In order to do this, you use the trig functions: Sin, Cos and Tan.</p>
<p>So now for how they work:<br />
(I will be referring to this pic in the example of how to use these functions)<br />
Sorry But currently I cant get the image tag to work...This pic is called tut.jpg in the zip file you download below</p>
<p>See the (put in ascii for theta) in that picture? That symbol is called theta and refers to a certain angle in the trangle seen in the picture. theta can be placed in any angle in that triangle but for this example it I will be using the above angle.<br />
The text SOH CAH TOA is how sin cos and tan work, and SOH CAH TOA is a little trick for remembering how they work. Here&#39;s what the letters mean:<br />
S = Sin, C = Cos, T = Tan, O = Opposite, A = Adjacent, H = Hypotenuse<br />
Opposite being the site opposite of the angle (side A), Adjacent being the side adjacent to the angle (side B), and the hypotenuse (side C)<br />
Now that you know what the symbols mean this is how it works:<br />
SOH : The Sin of the angle (theta) is equal to the Opposite side over the Hypotenuse. (Shown in the text below SOH CAH TOA)<br />
CAH : The Cos of the angle (theta) is equal to the Adjacent side over the Hypotenuse. (Shown in the text below SOH CAH TOA)<br />
TOA : The Tan of the angle (theta) is equal to the Opposite side over the Adjacent side. (Shown in the text below SOH CAH TOA)</p>
<p>This is the minimum knowledge about trig you need to know for this tut. Thanks for hanging in there with me! Now for making our character move on slopes!!!</p>
<p>So here&#39;s our strategy in this. Now that we know how to find an angle between any side in a triangle, if we have one point above the character and one point as the middle of the character, we can find the angle of the slope. Check out the pic for a visual explanation<br />
Sorry But currently I cant get the image tag to work...This pic is called tut-pic2.jpg in the zip file you download below</p>
<p>The rest of the tutorial is written inside the FLA file!</p>
<p><a href="&#34;//www.megaupload.com/?d=P2XF71WR&#34;">GRAB THE FILES HERE!!</a></p>
<p>Hope you guys enjoy! Any comments, suggestions and corrections are much appreciated!</p>
<p>-Fox
</p>]]></description>
					</item>
		<item>
			<title>Frozoth on "Upside-Down Slope: A Flash Tragedy"</title>
			<link>http://www.bornegames.com/forum/topic/upside-down-slope-a-flash-tragedy#post-21066</link>
			<pubDate>Mon, 11 May 2009 23:39:39 +0000</pubDate>
			<dc:creator>Frozoth</dc:creator>
			<guid isPermaLink="false">21066@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>Okay, I've been working on a basic outline for a platformer I'm planning to make called "Go!" and I'm constantly running into the same problem while working on slope code: how the heck do you get the character to run smoothly on a slope larger than 90 degrees?!</p>
<p>Right now, I'm using an atan2 function to rotate the character, so if anyone has any ideas or knows how Brad did it so well in FPA, that'd be awesome.
</p>]]></description>
					</item>
		<item>
			<title>MrActionScription on "HELP PLEASE!!!!"</title>
			<link>http://www.bornegames.com/forum/topic/help-please#post-33806</link>
			<pubDate>Sun, 30 Aug 2009 05:54:42 +0000</pubDate>
			<dc:creator>MrActionScription</dc:creator>
			<guid isPermaLink="false">33806@http://www.bornegames.com/forum/</guid>
			<description><![CDATA[<p>I am having so much trouble with this!!! :@ I&#39;ve posted the same thing on so many sites without getting any good help!!! So plz help me if you come across this!!!!</p>
<p>I&#39;ve made it so my character can walk along slopes but he dosn&#39;t really stick to the ground and it&#39;s really choppy not to mention he cant walk up slopes that are too steep!! </p>
<p>========================================================================<br />
Heres a link to the game</p>
<p><a href="http://spamtheweb.com/ul/upload/290809/78070_stickman_odo_5.php" rel="nofollow">http://spamtheweb.com/ul/upload/290809/78070_stickman_odo_5.php</a><br />
+=======================================================================</p>
<p>Here is the actionscript to my game!! </p>
<p>====================================================</p>
<p>onClipEvent (load) {<br />
	var dir = 1;<br />
	var jmp:Boolean = false;<br />
	var grav:Number = 0;<br />
	var speed:Number = 10;<br />
	var jumpHeight:Number = 9;<br />
	var slow:Number = .7;<br />
	var slowspd:Number = speed/1.5;<br />
	var setspeed:Number = speed;<br />
	var scale:Number = _xscale;<br />
	var ex:Number = 5;<br />
	rotation = 0;<br />
	this.gotoAndStop(2);<br />
}<br />
onClipEvent (enterFrame) {<br />
	grav++;<br />
	_y += grav;<br />
	while (_root.ground.hitTest(_x, _y, true)) {<br />
		_y--;<br />
		grav = 0;<br />
	}<br />
	back = player._y;<br />
	front = player._y;<br />
	center = player._y;<br />
	if (slope.hitTest(player._x-20, back, true)) {<br />
		back -= 1;<br />
	}<br />
	if (!slope.hitTest(player._x-20, back-1, true)) {<br />
		back += 1;<br />
	}<br />
	if (slope.hitTest(player._x+20, front, true)) {<br />
		front -= 1;<br />
	}<br />
	if (!slope.hitTest(player._x+20, front+1, true)) {<br />
		front += 1;<br />
	}<br />
	if (slope.hitTest(player._x, center, true)) {<br />
		center -= 1;<br />
	}<br />
	if (!slope.hitTest(player._x, center+1, true)) {<br />
		center += 1;<br />
	}<br />
	player._y = center;<br />
	p1._x = player._x+20;<br />
	p2._x = player._x-20;<br />
	p1._y = front;<br />
	p2._y = back;<br />
	player._rotation = Math.atan2(front-back, 40)*180/Math.PI;<br />
	ang = (char._rotation)*(Math.PI/180);<br />
	char._x += yspeed*Math.sin(ang);<br />
	char._y += yspeed*Math.cos(ang);<br />
	char._x += xspeed*Math.cos(ang);<br />
	char._y += xspeed*Math.sin(ang);<br />
	ang = char._rotation/57.3;<br />
	if (!jmp) {<br />
		char._x += speed*Math.cos(ang);<br />
		char._y += speed*Math.sin(ang);<br />
		if (!(char.hitTest(ground))) {<br />
			jmp = true;<br />
			xv = speed*Math.cos(ang);<br />
			yv = speed*Math.sin(ang);<br />
		}<br />
	} else if (jmp) {<br />
		yv += 0.4;<br />
		char._y += yv;<br />
		char._x += xv;<br />
	}<br />
	if (_root.ground.hitTest(_x, _y+3, true)) {<br />
	}<br />
	while (_root.ground.hitTest(_x, _y, true)) {<br />
		_y--;<br />
		grav = 0;<br />
		jmp = false;<br />
	}<br />
	if (_root.water.hitTest(_x, _y, true)) {<br />
		if (grav&#62;0) {<br />
			grav *= slow;<br />
		}<br />
		speed = slowspd;<br />
	} else {<br />
		speed = setspeed;<br />
	}<br />
	if (Key.isDown(Key.RIGHT)) {<br />
		_x += speed;<br />
		_xscale = scale;<br />
		this.dir = 1;<br />
		if (_root.ground.hitTest(_x, _y+3, true)) {<br />
			this.gotoAndStop(1);<br />
		} else {<br />
			this.gotoAndStop(2);<br />
		}<br />
	} else if (Key.isDown(Key.LEFT)) {<br />
		_x -= speed;<br />
		_xscale = -scale;<br />
		this.dir = -1;<br />
		if (_root.ground.hitTest(_x, _y+3, true)) {<br />
			this.gotoAndStop(1);<br />
		} else {<br />
			this.gotoAndStop(2);<br />
		}<br />
	} else {<br />
		if (_root.ground.hitTest(_x, _y+3, true) &#38;&#38; !Key.isDown(1) &#38;&#38; !Key.isDown(1)) {<br />
			this.gotoAndStop(3);<br />
		}<br />
	}<br />
	if (Key.isDown(Key.SPACE) &#38;&#38; _root.ground.hitTest(_x, _y+3, true)) {<br />
		grav = -jumpHeight;<br />
		_y -= 4;<br />
		jmp = true;<br />
		this.gotoAndStop(2);<br />
	}<br />
	if (_root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/2), true) &#124;&#124; _root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/6), true) &#124;&#124; _root.ground.hitTest(_x+(_width/2)+ex, _y-_height, true)) {<br />
		_x -= speed;<br />
	}<br />
	if (_root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/2), true) &#124;&#124; _root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/6), true) &#124;&#124; _root.ground.hitTest(_x-(_width/2)-ex, _y-_height, true)) {<br />
		_x += speed;<br />
	}<br />
	if (_root.ground.hitTest(_x, _y-_height-15, true)) {<br />
		grav = 1;<br />
	}<br />
	if (jmp=true &#38;&#38; deg&#62;90) {<br />
		this._rotation*.001;<br />
	}<br />
	this._xscale = this.dir*Math.abs(this._xscale);<br />
}</p>
<p>====================================================================
</p>]]></description>
					</item>

	</channel>
</rss>

