city41/breakouts — pull request #57 by ErnstHaagsman (2014-03-18 13:58:21+00:00)
Title: Refactored determineBounceVelocityX method

I'm currently attempting to write a new implementation of the breakout game, and in the process looked at the phaser code to figure out how the paddle/ball bouncing worked. The phaser code was not exactly easily readable, so I decided to refactor it. The submitted code here is functionally equivalent to the old code.

The vertical right hand side bounce code was deleted, because the condition

```
if (_ball.body.bottom > _paddle.body.x)
```

is always true. The game is 320 pixels wide, and the paddle is at 368 pixels down. So the ball's bottom must be >= 368 for a collision to occur, and the paddle can never be further to the right than 320.