summaryrefslogtreecommitdiff
path: root/noncore/games/bounce/game.cpp
Unidiff
Diffstat (limited to 'noncore/games/bounce/game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/game.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp
index c07f453..1f1f8cd 100644
--- a/noncore/games/bounce/game.cpp
+++ b/noncore/games/bounce/game.cpp
@@ -312,31 +312,31 @@ JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name )
312 for ( int x=0; x<FIELD_WIDTH; x++ ) 312 for ( int x=0; x<FIELD_WIDTH; x++ )
313 m_field->setTile( x, 0, TILE_BORDER ); 313 m_field->setTile( x, 0, TILE_BORDER );
314 for ( int y=1; y<FIELD_HEIGHT-1; y++ ) 314 for ( int y=1; y<FIELD_HEIGHT-1; y++ )
315 { 315 {
316 m_field->setTile( 0, y, TILE_BORDER ); 316 m_field->setTile( 0, y, TILE_BORDER );
317 for ( int x=1; x<FIELD_WIDTH-1; x++ ) 317 for ( int x=1; x<FIELD_WIDTH-1; x++ )
318 m_field->setTile( x, y, TILE_FREE ); 318 m_field->setTile( x, y, TILE_FREE );
319 m_field->setTile( FIELD_WIDTH-1, y, TILE_BORDER ); 319 m_field->setTile( FIELD_WIDTH-1, y, TILE_BORDER );
320 } 320 }
321 for ( int x=0; x<FIELD_WIDTH; x++ ) 321 for ( int x=0; x<FIELD_WIDTH; x++ )
322 m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER ); 322 m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER );
323 323
324 connect( m_field, SIGNAL(ballCollision(Ball *, int, int, int)), this, SLOT(ballCollision(Ball *, int, int, int)) ); 324 connect( m_field, SIGNAL(ballCollision(Ball*,int,int,int)), this, SLOT(ballCollision(Ball*,int,int,int)) );
325 325
326 // create view 326 // create view
327 m_view = new JezzView( m_field, this, "m_view" ); 327 m_view = new JezzView( m_field, this, "m_view" );
328 m_view->move( 0, 0 ); 328 m_view->move( 0, 0 );
329 m_view->adjustSize(); 329 m_view->adjustSize();
330 connect( m_view, SIGNAL(buildWall(int, int, bool)), this, SLOT(buildWall(int, int, bool)) ); 330 connect( m_view, SIGNAL(buildWall(int,int,bool)), this, SLOT(buildWall(int,int,bool)) );
331 331
332 // create balls 332 // create balls
333 for ( int n=0; n<ballNum; n++ ) 333 for ( int n=0; n<ballNum; n++ )
334 { 334 {
335 Ball *ball = new Ball( m_ballPixmaps, m_field ); 335 Ball *ball = new Ball( m_ballPixmaps, m_field );
336 m_balls.append( ball ); 336 m_balls.append( ball );
337 ball->setVelocity( ((rand() & 1)*2-1)*2, ((rand() & 1)*2-1)*2 ); 337 ball->setVelocity( ((rand() & 1)*2-1)*2, ((rand() & 1)*2-1)*2 );
338 ball->setFrame( rand() % 25 ); 338 ball->setFrame( rand() % 25 );
339 ball->move( 4*TILE_SIZE + ( rand() - 50 ) % ( (FIELD_WIDTH-8)*TILE_SIZE ), 339 ball->move( 4*TILE_SIZE + ( rand() - 50 ) % ( (FIELD_WIDTH-8)*TILE_SIZE ),
340 4*TILE_SIZE + rand() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) ); 340 4*TILE_SIZE + rand() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) );
341 ball->show(); 341 ball->show();
342 } 342 }
@@ -516,35 +516,35 @@ void JezzGame::buildWall( int x, int y, bool vertical )
516 //kdDebug() << "Direct collision" << endl; 516 //kdDebug() << "Direct collision" << endl;
517 emit ballCollision( (Ball*)cols.first(), x, y, TILE_WALLUP ); 517 emit ballCollision( (Ball*)cols.first(), x, y, TILE_WALLUP );
518 return; 518 return;
519 } 519 }
520 520
521 // start walls 521 // start walls
522 if ( !m_wall1 ) 522 if ( !m_wall1 )
523 { 523 {
524 m_wall1 = new Wall( m_field, x, y, 524 m_wall1 = new Wall( m_field, x, y,
525 vertical? Wall::Up : Wall::Left, 525 vertical? Wall::Up : Wall::Left,
526 vertical? TILE_WALLUP : TILE_WALLLEFT, 526 vertical? TILE_WALLUP : TILE_WALLLEFT,
527 this, "m_wall1" ); 527 this, "m_wall1" );
528 connect( m_wall1, SIGNAL(finished(Wall *, int)), 528 connect( m_wall1, SIGNAL(finished(Wall*,int)),
529 this, SLOT(wallFinished(Wall *, int)) ); } 529 this, SLOT(wallFinished(Wall*,int)) ); }
530 530
531 if ( !m_wall2 ) 531 if ( !m_wall2 )
532 { 532 {
533 m_wall2 = new Wall( m_field, x, y, 533 m_wall2 = new Wall( m_field, x, y,
534 vertical? Wall::Down: Wall::Right, 534 vertical? Wall::Down: Wall::Right,
535 vertical? TILE_WALLDOWN : TILE_WALLRIGHT, 535 vertical? TILE_WALLDOWN : TILE_WALLRIGHT,
536 this, "m_wall2" ); 536 this, "m_wall2" );
537 connect( m_wall2, SIGNAL(finished(Wall *, int)), 537 connect( m_wall2, SIGNAL(finished(Wall*,int)),
538 this, SLOT(wallFinished(Wall *, int)) ); 538 this, SLOT(wallFinished(Wall*,int)) );
539 } 539 }
540 } 540 }
541} 541}
542 542
543void JezzGame::wallFinished( Wall *wall, int tile ) 543void JezzGame::wallFinished( Wall *wall, int tile )
544{ 544{
545 if ( tile==TILE_WALLEND ) 545 if ( tile==TILE_WALLEND )
546 { 546 {
547 if ( m_wall1 ) 547 if ( m_wall1 )
548 { 548 {
549 m_wall1->fill( false ); 549 m_wall1->fill( false );
550 delete m_wall1; 550 delete m_wall1;