Ball needs to bounce off moving platform in random directions to hit bricks

Mt student wants the ball to bounce of the moving platform (controlled by user input) and then go in different directions when bouncing off bricks.

Hi @hcooper,
I would encourage the student to debug this some. Point out to them that while there are .isTouching code for all of the blocks, there are none for the platform. The ball doesn’t know what to do if it hits the platform. Thoughts?

1 Like

Maybe they added “bounceOff” block after this was posted. That should be what makes the ball bounce off the platform, but instead, the ballvelocityY and the bounciness are kind of cancelling each other out. However, Let me give you a suggestion to get your student to the next step. The platform animation has a lot of empty space above it, so if you have them turn on the debugging, (Debug Sprites: On), this may help them to see what is happening.

the ball is resting on the platform even though it doesn’t appear to be because the platform has some invisible space above it. If they open the animation and crop the platform sprite, this will remove the invisible space above the platform and the next time they run it, they will see some ball movement and then be able to adjust the bounciness and velocity to get to the next step.

This is the crop button:
Screen Shot 2020-02-27 at 10.05.23 PM

Let us know how it goes!