Student is working on creating her game and would like to use a block similar to “istouching”…is this an option? She wants a player to be able to push another player off the screen but is struggling with how to code this correctly.
Any tips?
Student is working on creating her game and would like to use a block similar to “istouching”…is this an option? She wants a player to be able to push another player off the screen but is struggling with how to code this correctly.
Any tips?
Sarah,
I don’t believe there is a simple block like “isTouching” in App Lab. I was curious to see if I could find anyone who had used “collision detection” in App Lab and I did find a Youtube tutorial on it where Bill Barnum explains how he programmed collision detection on his own and I found another (very long) Youtube tutorial on making the Pong game in App Lab that also involves collision detection.
So I guess anything is possible.
Over on the CS Principles forum, there was also a good discussion on why App Lab doesn’t have collision detection and the net consensus is that students would have to program their own “isTouching” function to mimic that capacity that is already in Game Lab.
Anyone else have any ideas?
Mike
Hi Sarah,
If you check out the “Star Chaser” game in Lesson 14 Physical Computing unit, it has some basic collision detection under the “detect hit” function in line 54 of the starter code. You can also advise that the student go back to the original collision detection in Games and Animations. At the beginning of the lesson, students explore how to do simple collision detection with code before starting to use the collisions blocks.
Elizabeth
Elizabeth