Need Help with Debugging

Hi, I really need help with my snap program! I spent hours on it, but I still have no idea on the bug.

  1. One problem is that the ball does not sense the bottom of the stage (I placed it a black sprite) and the paddle and goes through them. Instead of hitting them, the ball goes through these two sprites. I have used the sense blocks 'touch [sprite] and 'touch [color]' sensing block. So, I used this:

When I receive Hit:

If Y position > 59 and Y Position < 59 and Y position = 59
go to front
point towards 180 - direction and move 10 steps
if on edge, bounce

However, this doesn't work well because the second problem

  1. Every time I open Snap to edit the program, the paddle and ball end up in different locations. For example, when I start the game the ball should be in position (20,30) and it would appear say in the center. However, upon opening the game and starting it, the ball would end up in the lower left corner. This is the same for the paddle.

Some say, that it was because I drew the sprites off center, but I have no idea how to fix this.

Could you share your project? It would be easier to help you, looking at what's going on. As you said, the problem must be at the beginning, drawing these sprites and their center... but I need to see the project to say more...


The Y position can't be both more than 59 and less than 59! Maybe you meant OR instead of AND? But then, why use the IF at all?

The first line already does what IF ON EDGE BOUNCE does. So you'll end up turning around twice.

I fixed how to draw the spites in the center, but I am still having trouble with the ball sensing the paddle and I have tried both 'touching' paddles as you can see. Also, the sprite is having trouble with sensing the bottom of the stage and I have tried both touching blocks and using

if y-position > -125 or y = -125 (the paddle's set position)
broadcast game over

Could you share the project, or give us a link? It makes debugging so much easier because the problem could be elsewhere in the project.