Player Library
Diff: Player.cpp
- Revision:
- 2:108a1fc56c4c
- Parent:
- 1:933b7aa73bbc
- Child:
- 3:60a09496c839
--- a/Player.cpp Mon Apr 24 11:05:42 2017 +0000 +++ b/Player.cpp Mon Apr 24 11:15:03 2017 +0000 @@ -50,9 +50,26 @@ if (d == E) { _x+=_speed; } - if (d ==W) { + if (d == W) { _x-=_speed; } + if (d == NE) { + _y-=_speed/2; + _x+=_speed/2; + } + if (d == NW) { + _y-=_speed/2; + _x-=_speed/2; + } + if (d == SE) { + _y+=_speed/2; + _x+=_speed/2; + } + if (d == SW) { + _y+=_speed/2; + _x-=_speed/2; + } + // check the y origin to ensure that the paddle doesn't go off screen if (_y < 1) {