# Collision Detection In App Lab

**URL:** <https://forum.code.org/t/collision-detection-in-app-lab/6309>\
**Category:** CS Principles\
**Created:** [December 14, 2016, 4:17pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309 "2016-12-14T16:17:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![esumner](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@esumner](https://forum.code.org/u/esumner)\
**Post date:** [December 14, 2016, 4:17pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/1 "2016-12-14T16:17:20Z")

</div>

Do any of you know how to program collision detection in the App Lab. I have a student making a maze and he needs to detect if they run into a wall. Thank you.

---

<div class="post-metadata">

**Author:** ![terence.stone25](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/terence.stone25/32/5124_2.png) [@terence.stone25](https://forum.code.org/u/terence.stone25)\
**Post date:** [December 14, 2016, 8:29pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/2 "2016-12-14T20:29:58Z")

</div>

Hi Erin,  
I’ll pass this on for you. Look for an answer soon.

---

<div class="post-metadata">

**Author:** ![baker](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/baker/32/1229_2.png) [@baker](https://forum.code.org/u/baker)\
**Post date:** [December 14, 2016, 8:36pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/3 "2016-12-14T20:36:00Z")

</div>

It depends. How is the maze created? What is the character. If you can get the share link for the project and paste here, I can take a look.

–Baker  
CSP Team

---

<div class="post-metadata">

**Author:** ![mr\_odonnell\_cte](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mr_odonnell_cte/32/577_2.png) [@mr\_odonnell\_cte](https://forum.code.org/u/mr_odonnell_cte)\
**Post date:** [February 14, 2017, 3:10pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/4 "2017-02-14T15:10:19Z")

</div>

It seems like this is a pretty in-demand issue, I have several students that have some up with this independently. Can you provide a general answer so that I can guide my students on the best way to accomplish a maze?

---

<div class="post-metadata">

**Author:** ![kmclead](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kmclead](https://forum.code.org/u/kmclead)\
**Post date:** [February 15, 2017, 1:25pm UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/5 "2017-02-15T13:25:33Z")

</div>

I have been working on a one-button game with my Video Game Design class, and used a for loop to detect collision. I named all objects the same, with different numbers at the end. I imagine you could do the same with walls to determine if your player runs into a wall.

My function is called “arrowCollider”. I hope that the for loop is useful to you!

> **[Check out what I made](https://studio.code.org/projects/applab/IXOjWADKBEyigUenl7JAjg)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![wbarnum](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/wbarnum/32/1372_2.png) [@wbarnum](https://forum.code.org/u/wbarnum)\
**Post date:** [February 25, 2018, 3:59am UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/6 "2018-02-25T03:59:06Z")

</div>

I’ve put together a tutorial for making a simple arcade game in App Lab. It includes a part about creating simple collision detection function.

[Make an Arcade Game in Code.org App Lab](https://www.youtube.com/playlist?list=PLmpmyPywZ443h-rbw19veYs2grRp4QtUz)

---

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [March 16, 2018, 2:23am UTC](https://forum.code.org/t/collision-detection-in-app-lab/6309/7 "2018-03-16T02:23:00Z")

</div>

Great job. Thanks for posting!
