# Unit 5 Activity & Turtle - Is there an id for the turtle

**URL:** <https://forum.code.org/t/unit-5-activity-turtle-is-there-an-id-for-the-turtle/25200>\
**Category:** CS Principles\
**Tags:** csp-unit-5\
**Created:** [March 1, 2019, 2:54pm UTC](https://forum.code.org/t/unit-5-activity-turtle-is-there-an-id-for-the-turtle/25200 "2019-03-01T14:54:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![frank\_w\_lee](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/frank_w_lee/32/4895_2.png) [@frank\_w\_lee](https://forum.code.org/u/frank_w_lee)\
**Post date:** [March 2, 2019, 4:22am UTC](https://forum.code.org/t/unit-5-activity-turtle-is-there-an-id-for-the-turtle/25200/2 "2019-03-02T04:22:10Z")

</div>

I know one of the events is if you have the mouse hover over the element, but as far as I know, there’s no event for when the turtle is in the same position as an element.

Basically you’re looking to do “collision detection”, something not built into App Lab. There’s been a few posts about it in the past. Looks like there might be a way that requires a bit more coding:

> [@Collision Detection In App Lab](https://forum.code.org/t/collision-detection-in-app-lab/6309/6):
>
> 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)

> [@Collision detection of multiple objects in app lab](https://forum.code.org/t/collision-detection-of-multiple-objects-in-app-lab/12655):
>
> Hi, I am attempting to set up collision detection in a maze environment so that a ball can pass through the maze and properly collide with the walls… many of my students are interested in this sort of thing so I have been trying to get it to work myself… Here is a link to the code: [https://studio.code.org/projects/applab/mV1iXG1eshIZtb27dHT9Xw](https://studio.code.org/projects/applab/mV1iXG1eshIZtb27dHT9Xw) any thoughts? I know game lab has built in collision detection, but many of my students are uncomfortable changing platforms when it comes to preparing…

> [@Why does App Lab not have collision detection?](https://forum.code.org/t/why-does-app-lab-not-have-collision-detection/7105):
>
> Will [Code.org](http://Code.org) implement a collision detector for CSP’s App Lab? I have a lot of students wanting to incorporate this into their Create Task but are having difficulty implementing. Doug McNally has made a great tutorial video, [found here](https://www.youtube.com/watch?v=62SZPhJjKmc) but I am also teaching CS Discoveries and coincidentally we are on Unit 3 Stage 12 (Collision Detection). For this section, it’s very intuitive and easy to detect collisions, but in App Lab, it’s no longer easy. Is there a reason for this I’m completely missing? …

> [@’15 -’16 General Discussion for Lesson 5.18](https://forum.code.org/t/15-16-general-discussion-for-lesson-5-18/2839/8):
>
> Hey Katie, Currently App Lab doesn’t easily support this kind of interaction. There’s no command like turtleIsTounching(color) which a student could use within an if-statement to prevent a turtle from moving through walls, change the score, etc. There are ways you could do this by manually performing collision detection (i.e. keeping track of the locations of all walls and the turtle and comparing to make sure the turtle isn’t touching one), but depending on the programming ability of the stude…

---

_[View the full topic](https://forum.code.org/t/unit-5-activity-turtle-is-there-an-id-for-the-turtle/25200)._
