summaryrefslogtreecommitdiff
path: root/noncore/games
Unidiff
Diffstat (limited to 'noncore/games') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/game.cpp12
-rw-r--r--noncore/games/buzzword/buzzword.cpp2
-rw-r--r--noncore/games/kpacman/kpacman.cpp4
-rw-r--r--noncore/games/oyatzee/oyatzee.cpp4
4 files changed, 11 insertions, 11 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;
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp
index 13eb481..b7f2573 100644
--- a/noncore/games/buzzword/buzzword.cpp
+++ b/noncore/games/buzzword/buzzword.cpp
@@ -102,25 +102,25 @@ void BuzzWord::drawGrid()
102 102
103 grid = new QGrid(gridVal, this); 103 grid = new QGrid(gridVal, this);
104 //grid->setFixedSize( 480, 480 ); 104 //grid->setFixedSize( 480, 480 );
105 105
106 for( int c = 0 ; c < gridVal ; c++ ) 106 for( int c = 0 ; c < gridVal ; c++ )
107 { 107 {
108 for( int r = 0 ; r < gridVal ; r++ ) 108 for( int r = 0 ; r < gridVal ; r++ )
109 { 109 {
110 uint pos = rand() % l. count(); 110 uint pos = rand() % l. count();
111 111
112 QString word = QStringList::split(" ", l[pos]).join("\n"); 112 QString word = QStringList::split(" ", l[pos]).join("\n");
113 BuzzItem* bi = new BuzzItem( c, r, word, grid ); 113 BuzzItem* bi = new BuzzItem( c, r, word, grid );
114 connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); 114 connect( bi, SIGNAL(clicked(int,int)), this, SLOT(clicked(int,int)) );
115 map[c][r] = 0; 115 map[c][r] = 0;
116 116
117 l.remove( l.at( pos )); 117 l.remove( l.at( pos ));
118 } 118 }
119 } 119 }
120} 120}
121 121
122void BuzzWord::clicked(int row, int column) 122void BuzzWord::clicked(int row, int column)
123{ 123{
124 if ( ! gameOver ) 124 if ( ! gameOver )
125 { 125 {
126 int rowTotal = 0; 126 int rowTotal = 0;
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index be2e46d..9820e5a 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -24,26 +24,26 @@ Kpacman::Kpacman(QWidget *parent, const char *name)
24 m_view = new QWidget( this, "m_view" ); 24 m_view = new QWidget( this, "m_view" );
25 m_view->setBackgroundColor( black ); 25 m_view->setBackgroundColor( black );
26 m_layout = new QGridLayout( m_view ); 26 m_layout = new QGridLayout( m_view );
27 m_layout->setMargin( 7 ); 27 m_layout->setMargin( 7 );
28 28
29 view = new KpacmanWidget( this, QString(name)+"widget"); 29 view = new KpacmanWidget( this, QString(name)+"widget");
30 m_layout->addWidget( view, 0, 0 ); 30 m_layout->addWidget( view, 0, 0 );
31 31
32 setCaption( tr("KPacman") ); 32 setCaption( tr("KPacman") );
33 33
34 view->referee->setFocus(); 34 view->referee->setFocus();
35 35
36 connect(view->referee, SIGNAL(setScore(int, int)), 36 connect(view->referee, SIGNAL(setScore(int,int)),
37 view->score, SLOT(setScore(int, int))); 37 view->score, SLOT(setScore(int,int)));
38 connect(view->referee, SIGNAL(setPoints(int)), 38 connect(view->referee, SIGNAL(setPoints(int)),
39 view->score, SLOT(set(int))); 39 view->score, SLOT(set(int)));
40 connect(view->referee, SIGNAL(setLifes(int)), 40 connect(view->referee, SIGNAL(setLifes(int)),
41 view->status, SLOT(setLifes(int))); 41 view->status, SLOT(setLifes(int)));
42 connect(view->referee, SIGNAL(setLevel(int)), 42 connect(view->referee, SIGNAL(setLevel(int)),
43 view->status, SLOT(setLevel(int))); 43 view->status, SLOT(setLevel(int)));
44 connect(view->referee, SIGNAL(forcedHallOfFame(bool)), 44 connect(view->referee, SIGNAL(forcedHallOfFame(bool)),
45 this, SLOT(forcedHallOfFame(bool))); 45 this, SLOT(forcedHallOfFame(bool)));
46 connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); 46 connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused()));
47 connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); 47 connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
48 48
49 connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); 49 connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
diff --git a/noncore/games/oyatzee/oyatzee.cpp b/noncore/games/oyatzee/oyatzee.cpp
index 86318db..a55aa73 100644
--- a/noncore/games/oyatzee/oyatzee.cpp
+++ b/noncore/games/oyatzee/oyatzee.cpp
@@ -20,25 +20,25 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
20 lastPlayerFinished = false; 20 lastPlayerFinished = false;
21 currentPlayer = 1; 21 currentPlayer = 1;
22 22
23 ps.append( new Player( "Carsten" ) ); 23 ps.append( new Player( "Carsten" ) );
24 ps.append( new Player( "Julia" ) ); 24 ps.append( new Player( "Julia" ) );
25 ps.append( new Player( "Christine" ) ); 25 ps.append( new Player( "Christine" ) );
26 ps.append( new Player( "Stephan" ) ); 26 ps.append( new Player( "Stephan" ) );
27 27
28 28
29 QVBoxLayout *vbox = new QVBoxLayout( thing ); 29 QVBoxLayout *vbox = new QVBoxLayout( thing );
30 30
31 sb = new Scoreboard( ps, thing , "sb" ); 31 sb = new Scoreboard( ps, thing , "sb" );
32 connect( sb->pb , SIGNAL( item( int ) ), this , SLOT( slotEndRound( int ) ) ); 32 connect( sb->pb , SIGNAL( item(int) ), this , SLOT( slotEndRound(int) ) );
33 33
34 dw = new DiceWidget( thing , "dw" ); 34 dw = new DiceWidget( thing , "dw" );
35 dw->setMaximumHeight( this->height()/4 ); 35 dw->setMaximumHeight( this->height()/4 );
36 connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) ); 36 connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) );
37 37
38 vbox->addWidget( sb ); 38 vbox->addWidget( sb );
39 vbox->addWidget( dw ); 39 vbox->addWidget( dw );
40} 40}
41 41
42void OYatzee::slotEndRound( int item ) 42void OYatzee::slotEndRound( int item )
43{ 43{
44 qDebug( "Der User hat Nummer %d ausgewählt" , item ); 44 qDebug( "Der User hat Nummer %d ausgewählt" , item );
@@ -637,25 +637,25 @@ Possibilityboard::Possibilityboard( QWidget *parent , const char* name ) : Board
637 begriffe.append( "6er" ); 637 begriffe.append( "6er" );
638 begriffe.append( "Total" ); 638 begriffe.append( "Total" );
639 begriffe.append( "Bonus" ); 639 begriffe.append( "Bonus" );
640 begriffe.append( "3oaK" ); 640 begriffe.append( "3oaK" );
641 begriffe.append( "4oaK" ); 641 begriffe.append( "4oaK" );
642 begriffe.append( "Full House" ); 642 begriffe.append( "Full House" );
643 begriffe.append( "Short S" ); 643 begriffe.append( "Short S" );
644 begriffe.append( "Long S" ); 644 begriffe.append( "Long S" );
645 begriffe.append( "Yatzee!" ); 645 begriffe.append( "Yatzee!" );
646 begriffe.append( "Chance" ); 646 begriffe.append( "Chance" );
647 begriffe.append( "Score" ); 647 begriffe.append( "Score" );
648 648
649 connect( this , SIGNAL( clicked( QPoint ) ), this , SLOT( slotClicked( QPoint ) ) ); 649 connect( this , SIGNAL( clicked(QPoint) ), this , SLOT( slotClicked(QPoint) ) );
650} 650}
651 651
652void Possibilityboard::slotClicked( QPoint p) 652void Possibilityboard::slotClicked( QPoint p)
653{ 653{
654 emit item( p.y()/(this->height()/17) ); 654 emit item( p.y()/(this->height()/17) );
655} 655}
656 656
657void Possibilityboard::paintEvent( QPaintEvent* ) 657void Possibilityboard::paintEvent( QPaintEvent* )
658{ 658{
659 QPainter p; 659 QPainter p;
660 p.begin( this ); 660 p.begin( this );
661 661