summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-14 08:33:57 (UTC)
committer zecke <zecke>2003-05-14 08:33:57 (UTC)
commit79e34e9dc4870885c58f80c29a723d0227f7b788 (patch) (side-by-side diff)
tree1e91a0e6d698c782ef975e023288d4b9817e82c6
parent81a58bae78d693b67679d94d2f7fcdb300e12d4f (diff)
downloadopie-79e34e9dc4870885c58f80c29a723d0227f7b788.zip
opie-79e34e9dc4870885c58f80c29a723d0227f7b788.tar.gz
opie-79e34e9dc4870885c58f80c29a723d0227f7b788.tar.bz2
patch by Scott Bronson.
Add a little game description in the about messagebox
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/kbounce.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/games/bounce/kbounce.cpp b/noncore/games/bounce/kbounce.cpp
index f703f74..5d8aba3 100644
--- a/noncore/games/bounce/kbounce.cpp
+++ b/noncore/games/bounce/kbounce.cpp
@@ -68,97 +68,106 @@ KJezzball::KJezzball() : QMainWindow(0), m_gameWidget( 0 )
FilledLabel->setText( tr( "Filled: 00%" ) );
FilledLabel->setAlignment( int( QLabel::AlignCenter ) );
m_layout->addWidget( FilledLabel, 1, 1 );
TimeLabel = new QLabel( m_view, "TimeLabel" );
TimeLabel->setText( tr( "Time: 00" ) );
TimeLabel->setAlignment( int( QLabel::AlignCenter ) );
m_layout->addWidget( TimeLabel, 1, 3 );
// create timers
m_nextLevelTimer = new QTimer( this, "m_nextLevelTimer" );
connect( m_nextLevelTimer, SIGNAL(timeout()), this, SLOT(switchLevel()) );
m_gameOverTimer = new QTimer( this, "m_gameOverTimer" );
connect( m_gameOverTimer, SIGNAL(timeout()), this, SLOT(gameOverNow()) );
m_timer = new QTimer( this, "m_timer" );
connect( m_timer, SIGNAL(timeout()), this, SLOT(second()) );
// create demo game
createLevel( 1 );
}
void KJezzball::newGame()
{
// Check for running game
closeGame();
if ( m_state==Idle )
{
// update displays
m_game.level = 1;
m_game.score = 0;
setCaption(tr("Bounce Level %1").arg(m_game.level));
ScoreLabel->setText( tr( "Score: %1" ).arg(m_game.score) );
// start new game
m_state = Running;
createLevel( m_game.level );
startLevel();
}
}
void KJezzball::about()
{
- QMessageBox::information( this, "About", "Written by: Stefan Schimanski\nPorted by: Martin Imobersteg\n\nThis program is distributed under\nthe terms of the GPL v2." );
+ QMessageBox::information( this, "About",
+ "Written by: Stefan Schimanski\n"
+ "Ported by: Martin Imobersteg\n"
+ "\n"
+ "Click to form walls.\n"
+ "Hit space to switch wall direction.\n"
+ "Try to reduce total space by 75%.\n"
+ "\n"
+ "This program is distributed under\n"
+ "the terms of the GPL v2." );
}
void KJezzball::closeGame()
{
if ( m_state!=Idle )
{
stopLevel();
m_state = Idle;
}
}
void KJezzball::pauseGame()
{
switch ( m_state )
{
case Running:
m_state = Paused;
m_gameWidget->display( tr("Game paused.\nPress P to continue!") );
stopLevel();
break;
case Paused:
case Suspend:
m_state = Running;
m_gameWidget->display( QString::null );
startLevel();
break;
case Idle:
break;
}
}
void KJezzball::gameOver()
{
stopLevel();
m_gameOverTimer->start( 100, TRUE );
}
void KJezzball::gameOverNow()
{
m_state = Idle;
QString score;
score.setNum( m_game.score );
QMessageBox::information( this, "Game Over", tr("Game Over!\nScore: %1").arg(score) );
}