Ball "stuck" bouncing repeatedly against patform

I have about 6 actors in my new project (some walls, a ball (which i eventually want to spawn multiple balls according to time or score) and a small platform. I got the ball to bounce when it hits the platform, but after a few times of pressing my left and right buttons to move the platform, when the ball reaches the platform, it seems stuck bouncing against only the very top of the actor platform... i will try and post a video of what i am talking about. Thanks for your help.
Comments
as u can see, at bout 29 seconds in the video, the ball will bounce along the platform and if i stop the platform the ball will 'bounce in place' along the platform.
Help?
One way to fix this -- In the collision rule, constrain the ball's Y attribute to move up above the platform a little more. Then have it change direction.
do you mean put the 'collide' inside the rule option? cause i think the way its a few rules then collide by itself. and then would i just do 'constrain attribute' to a specific postion? correct?
that reminds me, is there a way within the scene to find X and Y inside the preview? like for example in photoshop there is show grid option. is that possible?
As for the second question -- I don't think there is a way to automatically show the x and y of an actor. But you could put a display text behavior into an actor. Then you can tell the behavior to display the x and y coordinates (or any other attributes) of the moving actor. In the display text behavior, use the expression editor to replace "Hello World!" with: (self.Position.X) ..(self.Position.Y)
http://tinypic.com/r/25j82mw/7
http://tinypic.com/r/2ikcvpy/7
now, i want the ball to go in random directions when it collides against the walls, kinda like it will shoot up from the platform to the walls and then go in a random direction, thus making it more difficult for the player to "catch" the ball..because my game u have to keep the ball at least in the air or on the paddle, or its game over.... but i tried everything i could think of including setting up different actors for horizontal and vertical walls...but i cant get it to work
** edit: btw the collide rule that is collapsed, is just a rule that when the ball hits the paddle, it plays my custom sound effect, and that is working 100%
To get the ball to bounce in a random direction you can check to see it it is colliding with an object and then set its velocity to a random number. So in your first pic, in your "when overlaps or collides with actor of type vertical wall" rule, add a "change velocity" behavior. Use the expression editor to set the velocity to a random number between 90 and 270 (since the ball is colliding with a vertical wall).
You would need to do the same kind of thing for the top wall -- random(180,360), and the bottom wall (er... floor) -- random(0,180)
I don't know about sound effect rules. I hear on these forums that sound needs some fixes in the next version.
Good luck with your first game! It sounds like its coming along nicely.