daily pastebin goal
70%
SHARE
TWEET

dazdadza

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void MainWindow::keyPressEvent(QKeyEvent *event)
  2. {
  3.     switch (event->key()){
  4.           case Qt::Key_Right:
  5.               if(_plateform->pos().rx()<250){
  6.                   _plateform->moveBy(10,0);
  7.               }
  8.  
  9.      break;
  10.           case Qt::Key_Left:
  11.          if(_plateform->pos().rx()>-240){
  12.              _plateform->moveBy(-10,0);
  13.          }
  14.      break;
  15.     case  Qt::Key_Space:
  16.         if( _flagBalllsMoving == false){
  17.         this->startBallAnimation();
  18.         }
  19.  
  20.       this->update();
  21.  
  22.  }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top