I built this Game last year for a project in game programming. Completely built in java script for web based HTML and CreateJS, TweenJS. Project was build in a program called brackets.
I programed when the ball hit the outer wall it would bound in the opposite direction but if ball hit the block or the paddle it would randomly choose to go straight, left or right if the paddle was missed player would loose a life and if all lives lost the player would lose the game. if the player wins the game a congratulations screen would appear and the player can choose to play again.