Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::keyPressEvent(QKeyEvent *event)
- {
- switch (event->key()){
- case Qt::Key_Right:
- if(_plateform->pos().rx()<250){
- _plateform->moveBy(10,0);
- }
- break;
- case Qt::Key_Left:
- if(_plateform->pos().rx()>-240){
- _plateform->moveBy(-10,0);
- }
- break;
- case Qt::Key_Space:
- if( _flagBalllsMoving == false){
- this->startBallAnimation();
- }
- this->update();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement