Loading t14/cannon.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) if ( ang == degrees ) return; return; ang = degrees; ang = degrees; repaint( cannonRect(), false ); update( cannonRect() ); emit angleChanged( ang ); emit angleChanged( ang ); } } Loading Loading @@ -72,10 +72,10 @@ void CannonField::newTarget() QTime midnight( 0, 0, 0 ); QTime midnight( 0, 0, 0 ); srand( midnight.secsTo(QTime::currentTime()) ); srand( midnight.secsTo(QTime::currentTime()) ); } } erase( targetRect() ); update( targetRect() ); target = QPoint( 200 + rand() % 190, target = QPoint( 200 + rand() % 190, 10 + rand() % 255 ); 10 + rand() % 255 ); repaint( targetRect() ); update( targetRect() ); } } void CannonField::setGameOver() void CannonField::setGameOver() Loading @@ -85,7 +85,7 @@ void CannonField::setGameOver() if ( shooting ) if ( shooting ) stopShooting(); stopShooting(); gameEnded = true; gameEnded = true; repaint(); update(); } } void CannonField::restartGame() void CannonField::restartGame() Loading @@ -93,12 +93,12 @@ void CannonField::restartGame() if ( shooting ) if ( shooting ) stopShooting(); stopShooting(); gameEnded = false; gameEnded = false; repaint(); update(); } } void CannonField::timerEvent( QTimerEvent * ) void CannonField::timerEvent( QTimerEvent * ) { { erase( shotRect() ); update( shotRect() ); timerCount++; timerCount++; QRect shotR = shotRect(); QRect shotR = shotRect(); Loading @@ -114,7 +114,7 @@ void CannonField::timerEvent( QTimerEvent * ) emit missed(); emit missed(); return; return; } } repaint( shotR, false ); update( shotR ); } } void CannonField::paintEvent( QPaintEvent *e ) void CannonField::paintEvent( QPaintEvent *e ) Loading Loading
t14/cannon.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) if ( ang == degrees ) return; return; ang = degrees; ang = degrees; repaint( cannonRect(), false ); update( cannonRect() ); emit angleChanged( ang ); emit angleChanged( ang ); } } Loading Loading @@ -72,10 +72,10 @@ void CannonField::newTarget() QTime midnight( 0, 0, 0 ); QTime midnight( 0, 0, 0 ); srand( midnight.secsTo(QTime::currentTime()) ); srand( midnight.secsTo(QTime::currentTime()) ); } } erase( targetRect() ); update( targetRect() ); target = QPoint( 200 + rand() % 190, target = QPoint( 200 + rand() % 190, 10 + rand() % 255 ); 10 + rand() % 255 ); repaint( targetRect() ); update( targetRect() ); } } void CannonField::setGameOver() void CannonField::setGameOver() Loading @@ -85,7 +85,7 @@ void CannonField::setGameOver() if ( shooting ) if ( shooting ) stopShooting(); stopShooting(); gameEnded = true; gameEnded = true; repaint(); update(); } } void CannonField::restartGame() void CannonField::restartGame() Loading @@ -93,12 +93,12 @@ void CannonField::restartGame() if ( shooting ) if ( shooting ) stopShooting(); stopShooting(); gameEnded = false; gameEnded = false; repaint(); update(); } } void CannonField::timerEvent( QTimerEvent * ) void CannonField::timerEvent( QTimerEvent * ) { { erase( shotRect() ); update( shotRect() ); timerCount++; timerCount++; QRect shotR = shotRect(); QRect shotR = shotRect(); Loading @@ -114,7 +114,7 @@ void CannonField::timerEvent( QTimerEvent * ) emit missed(); emit missed(); return; return; } } repaint( shotR, false ); update( shotR ); } } void CannonField::paintEvent( QPaintEvent *e ) void CannonField::paintEvent( QPaintEvent *e ) Loading