summaryrefslogtreecommitdiff
path: root/noncore
authorimm <imm>2002-09-20 21:17:49 (UTC)
committer imm <imm>2002-09-20 21:17:49 (UTC)
commit20c93734a4eada53d056f13558cbf60d6eff5bac (patch) (unidiff)
tree6ee73a9d1e5f9f5426ada0cb58ff60ad74bc876b /noncore
parent7027b4c29de455d457b7d62f52511216a8b76b9c (diff)
downloadopie-20c93734a4eada53d056f13558cbf60d6eff5bac.zip
opie-20c93734a4eada53d056f13558cbf60d6eff5bac.tar.gz
opie-20c93734a4eada53d056f13558cbf60d6eff5bac.tar.bz2
changed keys
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/referee.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/games/kpacman/referee.cpp b/noncore/games/kpacman/referee.cpp
index 9edaabd..70916f0 100644
--- a/noncore/games/kpacman/referee.cpp
+++ b/noncore/games/kpacman/referee.cpp
@@ -709,49 +709,53 @@ void Referee::setScheme(int Scheme, int Mode, Bitfont *font)
709 709
710 for (Monster *m = monsters->first(); m != 0; m = monsters->next()) 710 for (Monster *m = monsters->first(); m != 0; m = monsters->next())
711 if (m) 711 if (m)
712 m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); 712 m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix));
713 713
714 for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) 714 for (Energizer *e = energizers->first(); e != 0; e = energizers->next())
715 if (e) 715 if (e)
716 e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix)); 716 e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix));
717 717
718 if (gameState.testBit(Introducing)) 718 if (gameState.testBit(Introducing))
719 for (int i = 0; i < (gameState.testBit(Init) ? timerCount : 15); i++) 719 for (int i = 0; i < (gameState.testBit(Init) ? timerCount : 15); i++)
720 introPaint(i); 720 introPaint(i);
721 721
722 setFixedSize(pix->levelPix().size()); 722 setFixedSize(pix->levelPix().size());
723 repaint(); 723 repaint();
724} 724}
725 725
726void Referee::keyPressEvent( QKeyEvent *k ) 726void Referee::keyPressEvent( QKeyEvent *k )
727{ 727{
728 uint key = k->key(); 728 uint key = k->key();
729#ifdef QWS 729#ifdef QWS
730 // "OK" => new game 730 // "OK" => new game
731 if ( key == Key_F33 || key == Key_F2 || key == Key_Enter ) 731 if ( key == Key_F33 || key == Key_F2 || key == Key_Enter )
732 play(); 732 play();
733 else if ( !gameState.testBit(Playing) && key == Key_Space ) 733 else if ( !gameState.testBit(Playing) &&
734 key == Key_Up ||
735 key == Key_Down ||
736 key == Key_Right ||
737 key == Key_Left )
734 play(); 738 play();
735 // "Space" => pause 739 // "Space" => pause
736 //else if ( key == Key_Space || key == Key_F3 ) 740 //else if ( key == Key_Space || key == Key_F3 )
737 // pause(); 741 // pause();
738 // "Menu" => hall of fame 742 // "Menu" => hall of fame
739 //else if ( key == Key_F11 || key == Key_F4 ) 743 //else if ( key == Key_F11 || key == Key_F4 )
740 // toggleHallOfFame(); 744 // toggleHallOfFame();
741#endif 745#endif
742 746
743 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame) || 747 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame) ||
744 gameState.testBit(Demonstration) || gameState.testBit(Dying) || 748 gameState.testBit(Demonstration) || gameState.testBit(Dying) ||
745 gameState.testBit(Ready) || gameState.testBit(LevelDone) || 749 gameState.testBit(Ready) || gameState.testBit(LevelDone) ||
746 !gameState.testBit(Playing)) 750 !gameState.testBit(Playing))
747 return; 751 return;
748 752
749 if (key == UpKey) 753 if (key == UpKey)
750 pacman->setDirection(N); 754 pacman->setDirection(N);
751 else if (key == DownKey) 755 else if (key == DownKey)
752 pacman->setDirection(S); 756 pacman->setDirection(S);
753 else if (key == RightKey) 757 else if (key == RightKey)
754 pacman->setDirection(E); 758 pacman->setDirection(E);
755 else if (key == LeftKey) 759 else if (key == LeftKey)
756 pacman->setDirection(W); 760 pacman->setDirection(W);
757 761
@@ -925,49 +929,50 @@ void Referee::introPaint(int t)
925 case 7 : introMonster(2); 929 case 7 : introMonster(2);
926 break; 930 break;
927 case 8 : repaint(pix->draw(16, 22, RoomPix, tr("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE); 931 case 8 : repaint(pix->draw(16, 22, RoomPix, tr("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE);
928 break; 932 break;
929 case 9 : repaint(pix->draw(38, 22, RoomPix, tr("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE); 933 case 9 : repaint(pix->draw(38, 22, RoomPix, tr("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE);
930 break; 934 break;
931 case 10 : introMonster(3); 935 case 10 : introMonster(3);
932 break; 936 break;
933 case 11 : repaint(pix->draw(16, 28, RoomPix, tr("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE); 937 case 11 : repaint(pix->draw(16, 28, RoomPix, tr("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE);
934 break; 938 break;
935 case 12 : repaint(pix->draw(38, 28, RoomPix, tr("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE); 939 case 12 : repaint(pix->draw(38, 28, RoomPix, tr("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE);
936 break; 940 break;
937 case 13 : pts.sprintf("%d", pointScore); 941 case 13 : pts.sprintf("%d", pointScore);
938 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 942 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
939 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 943 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
940 pts.sprintf("%d", energizerScore); 944 pts.sprintf("%d", energizerScore);
941 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 945 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
942 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 946 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
943 break; 947 break;
944 case 14 : // "@ 1980 MIDWAY MFG.CO." 948 case 14 : // "@ 1980 MIDWAY MFG.CO."
945#if defined( KDE2_PORT ) 949#if defined( KDE2_PORT )
946 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE); 950 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE);
947#elif defined( QPE_PORT ) 951#elif defined( QPE_PORT )
948 repaint(pix->draw(30, 55, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE); 952 repaint(pix->draw(30, 55, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE);
949 repaint(pix->draw(29, 60, RoomPix, "Qtopia port: Catalin CLIMOV", GREEN), FALSE); 953 repaint(pix->draw(29, 58, RoomPix, tr("QTOPIA PORT: CATALIN CLIMOV"), GREEN), FALSE);
954 repaint(pix->draw(29, 61, RoomPix, tr("PRESS CURSOR TO START"), GREEN), FALSE);
950#endif 955#endif
951 break; 956 break;
952 } 957 }
953} 958}
954 959
955void Referee::introPlay() 960void Referee::introPlay()
956{ 961{
957 if (!gameState.testBit(Introducing) || gameState.testBit(Ready)) 962 if (!gameState.testBit(Introducing) || gameState.testBit(Ready))
958 return; 963 return;
959 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 964 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
960 QTimer::singleShot(afterPauseMS, this, SLOT(introPlay())); 965 QTimer::singleShot(afterPauseMS, this, SLOT(introPlay()));
961 return; 966 return;
962 } 967 }
963 968
964 if (!gameState.testBit(Init)) { 969 if (!gameState.testBit(Init)) {
965 if (monstersEaten == 4) { 970 if (monstersEaten == 4) {
966 stop(); 971 stop();
967 QTimer::singleShot(introPostAnimationMS, this, SLOT(demo())); 972 QTimer::singleShot(introPostAnimationMS, this, SLOT(demo()));
968 } 973 }
969 if (pacman->direction() == W) { 974 if (pacman->direction() == W) {
970 int id = -1; 975 int id = -1;
971 if (pacman->position() == 37*BoardWidth-6) 976 if (pacman->position() == 37*BoardWidth-6)
972 id = 0; 977 id = 0;
973 else 978 else