# How is this done?

**URL:** <https://forum.kirupa.com/t/how-is-this-done/204919>\
**Category:** Uncategorized\
**Created:** [October 24, 2006, 4:33pm UTC](https://forum.kirupa.com/t/how-is-this-done/204919 "2006-10-24T16:33:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pattt](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Pattt](https://forum.kirupa.com/u/Pattt)\
**Post date:** [October 24, 2006, 4:33pm UTC](https://forum.kirupa.com/t/how-is-this-done/204919/1 "2006-10-24T16:33:53Z")

</div>

Line Rider by \*fsk  
[http://www.deviantart.com/deviation/40255643/](http://www.deviantart.com/deviation/40255643/)

How is the collisions with the ground (line) done? Vectors?

:pope:

---

<div class="post-metadata">

**Author:** ![Joppe](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Joppe](https://forum.kirupa.com/u/Joppe)\
**Post date:** [October 24, 2006, 5:34pm UTC](https://forum.kirupa.com/t/how-is-this-done/204919/2 "2006-10-24T17:34:12Z")

</div>

Like this?  
[http://img339.imageshack.us/my.php?image=exampelrb2.swf](http://img339.imageshack.us/my.php?image=exampelrb2.swf)

If so, just do a hittest with shapeflag  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#808080]_// While or if_[/COLOR]  
[COLOR=#0000ff]while[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]this[/COLOR].\_y–;  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

Something like that…

Note; This is not the best example, becouse its using my code which sucks. So with a better engine for those particles it would work in all instances 🙂

edit: It doesnt seem to work, however im sure its just my code with the particles that messes it up…

---

<div class="post-metadata">

**Author:** ![Thinker2501](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thinker2501](https://forum.kirupa.com/u/Thinker2501)\
**Post date:** [October 24, 2006, 11:09pm UTC](https://forum.kirupa.com/t/how-is-this-done/204919/3 "2006-10-24T23:09:20Z")

</div>

Using hitTest is insanely inefficient, especially with shape tag and a large number of objects.

---

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [October 25, 2006, 3:33am UTC](https://forum.kirupa.com/t/how-is-this-done/204919/4 "2006-10-25T03:33:42Z")

</div>

That guys is based off of some sick line detection algorithm. Basically takes a normal array of lines and calculates where the dot hits… think that spider man thing but only in the downward direction.

The easiest way is to find the distance under the sled to a given line. Then use the angle that it intersects at to find the angle the sled is at… only hard part is multiple lines under the sled and verticle lines.

Actually i think im over simplifying it some.
