Only Score when touching sides of sprite

My student’s game is only scoring when it is touching the sides of the sprite (tram), but not the top. Here’s the code: Game Lab - Code.org

We have tried changing the collider box, even rotating it, but nothing is working. Any suggetions?

the code is bouncing the beach ball before checking for .isTouching
to prevent this you can check for .bounceOff in that statement directly

function drawscore() {
  if (beach.bounceOff(tram)) {
    score = score+1;
  }
}

and then remove the bounceOff being used in beachMovement

2 Likes

Thank you so much. I shared your suggestion with my student and he was able to get it to work.