Why does App Lab not have collision detection?

Will 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 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?

I have a lot of students that want to create games for their Create Task and it seems as though CS Discovery’s coding section would be more appropriate for them, but then they would have to start from the beginning there.

Is there a way to incorporate the two into one App? That would be ideal!

Thanks!

EDIT: Never mind. I guess they can just create the function “isTouching” and use that like the beginning of CS Discoveries has shown. It would be nice to have features similar to CS Discoveries in App Lab though…

Hi @joe_padon,

You ask a great question! We have two tools that use Javascript and droplet to teacher programming. They are look very similar in how the programming environment looks with things like the block to text transition, colored block palette, and a display area. However at the core App Lab and Game Lab function in different ways and serve different purposes. The biggest difference between the two is the programming model they rely on. App Lab is an event driven type of programming where as Game Lab uses the repeated loop (draw loop). This makes combining the two paradigms very tricky. As a result each tool is set up to support a certain type of programming best. The Game Lab draw loop and built in commands are set up to make things like collision detection easier. Although the CSP curriculum may stay centered around App Lab, our hope is in the future (when Game Lab is no longer in Beta) when students are working on their own project they will be able to choose the environment that is best for what they are working on.

Hope that helps clarify,

-Dani

1 Like

That’s great! Thanks for the explanation too. Now I can explain the difference to my students! I might add a collision detector unit when I go over Unit 5 next year to prepare them for more ideas to do with the Create task.

Thanks again, Dani.

1 Like

Agreed @joe_padon , that the biggest request I hear from students these days. Right now I have students using a “set interval” function to continuously execute code in their program and check that the “if-statements” are aligned. However, lots of students are running into issues where their movements are then moving faster each time they re-execute the code. I still haven’t determined why this would be, but it will be a weekend project for me…

That is happening because multiple instances of the timed loop (or setInterval) are running concurrently, which effectively doubles (or triples, etc) the update rate. When the student wants to “restart” something, they should first stop the first timedLoop/setInterval and then start a new one.