mirror of
https://github.com/abakh/nbsdgames.git
synced 2024-12-04 14:46:22 -05:00
More common controls
This commit is contained in:
parent
aaf092d106
commit
2199c6efd3
@ -267,7 +267,7 @@ void set_the_board(bool side){
|
||||
++px;
|
||||
if( input=='\n'||input==KEY_ENTER )
|
||||
break;
|
||||
if( input=='q' )
|
||||
if( (input=='q'||input==27) )
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@ -603,7 +603,7 @@ int main(int argc,char** argv){
|
||||
input=getch();
|
||||
if(input == KEY_F(1) || input=='?' )
|
||||
help(turn);
|
||||
if(input == KEY_F(2) )
|
||||
if((input==KEY_F(2)||input=='!') )
|
||||
gameplay(turn);
|
||||
if(input == KEY_MOUSE)
|
||||
mouseinput(1);
|
||||
@ -615,7 +615,7 @@ int main(int argc,char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<19)
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
if( input=='\n' || input==KEY_ENTER){
|
||||
byte r=shoot(turn,py,px-10);
|
||||
|
@ -661,7 +661,7 @@ int main(int argc,char** argv){
|
||||
input=getch();
|
||||
if( input == KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input == KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input == KEY_MOUSE )
|
||||
mouseinput();
|
||||
@ -673,7 +673,7 @@ int main(int argc,char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<7)
|
||||
++px;
|
||||
if( input=='q'){
|
||||
if( (input=='q'||input==27)){
|
||||
result=2;
|
||||
goto End;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ int main(int argc, char** argv){
|
||||
input = getch();
|
||||
if( input==KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input==KEY_MOUSE )
|
||||
mouseinput();
|
||||
@ -258,7 +258,7 @@ int main(int argc, char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<size-1)
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if(input=='\n'||input==KEY_ENTER){
|
||||
slide_multi(board,py,px);
|
||||
|
2
fisher.c
2
fisher.c
@ -353,7 +353,7 @@ int main(int argc,char** argv){
|
||||
}
|
||||
if(input=='?' || input==KEY_F(1))
|
||||
help();
|
||||
if(input=='q')
|
||||
if((input=='q'||input==27))
|
||||
break;
|
||||
if(!hooknum)
|
||||
break;
|
||||
|
2
jewels.c
2
jewels.c
@ -319,7 +319,7 @@ int main(int argc,char** argv){
|
||||
getch();
|
||||
halfdelay(DELAY);
|
||||
}
|
||||
else if(input=='q')
|
||||
else if((input=='q'||input==27))
|
||||
goto Lose;
|
||||
else if(input==' ')
|
||||
while( (falls=fall()) )
|
||||
|
@ -220,7 +220,7 @@ int main(int argc,char** argv){
|
||||
input = getch();
|
||||
if( input==KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input==KEY_MOUSE )
|
||||
mouseinput();
|
||||
@ -232,7 +232,7 @@ int main(int argc,char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<size2-1)
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if(input=='\n' || input==KEY_ENTER){
|
||||
if(fy!=-1 && board[py][px]==board[fy][fx] && !(fy==py && fx==px) )
|
||||
|
@ -439,7 +439,7 @@ int main(int argc,char** argv){
|
||||
}
|
||||
if( input == KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input == KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
halfspeed=!halfspeed;
|
||||
if( (input=='k' || (input==KEY_UP||input=='w')) ){
|
||||
@ -454,7 +454,7 @@ int main(int argc,char** argv){
|
||||
direction=LEFT;
|
||||
else if( (input=='l' || (input==KEY_RIGHT||input=='d')) )
|
||||
direction=RIGHT;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if(input=='e'){
|
||||
for(int b=0;b<6;++b){
|
||||
|
4
mines.c
4
mines.c
@ -360,7 +360,7 @@ int main(int argc, char** argv){
|
||||
}
|
||||
if( input==KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input==KEY_MOUSE )
|
||||
mouseinput(sy,sx);
|
||||
@ -372,7 +372,7 @@ int main(int argc, char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<wid-1)
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if(input=='x' && getch()=='y' && getch()=='z' && getch()=='z' && getch()=='y' ){
|
||||
if(first_click){
|
||||
|
@ -353,7 +353,7 @@ int main(int argc, char** argv){
|
||||
input = getch();
|
||||
if( input == KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( (input=='k' || (input==KEY_UP||input=='w')) && py>0 ){
|
||||
direction=UP;
|
||||
@ -369,7 +369,7 @@ int main(int argc, char** argv){
|
||||
direction=RIGHT;
|
||||
if( input=='e')
|
||||
epilepsy=1;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if( input=='p'){
|
||||
nocbreak();
|
||||
|
@ -282,7 +282,7 @@ int menu(char* entries,char* title){
|
||||
if(input=='\n'){
|
||||
return chosen;
|
||||
}
|
||||
if(input=='q'){
|
||||
if((input=='q'||input==27)){
|
||||
return -1;
|
||||
}
|
||||
goto Refresh;
|
||||
|
6
pipes.c
6
pipes.c
@ -387,7 +387,7 @@ int main(int argc, char** argv){
|
||||
if(!flow)
|
||||
tstart += time(NULL)-now;
|
||||
}
|
||||
if( input == KEY_F(2) ){
|
||||
if( (input==KEY_F(2)||input=='!') ){
|
||||
gameplay();
|
||||
if(!flow)
|
||||
tstart += time(NULL)-now;
|
||||
@ -436,13 +436,13 @@ int main(int argc, char** argv){
|
||||
flow=1;
|
||||
if( score < -1000)
|
||||
goto End;
|
||||
if( input=='q'){
|
||||
if( (input=='q'||input==27)){
|
||||
nocbreak();
|
||||
cbreak();
|
||||
curs_set(1);
|
||||
mvprintw(len+2,0,"Do you want to see the high scores?(y/n)");
|
||||
input=getch();
|
||||
if(input == 'N' || input=='n' || input =='q')
|
||||
if(input == 'N' || input=='n' || (input=='q'||input==27))
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
|
||||
show_scores(save_score());
|
||||
|
@ -272,7 +272,7 @@ int main(int argc,char** argv){
|
||||
if(sx< -(wid*2+1))
|
||||
sx=-(wid*2+1);
|
||||
}
|
||||
if( input == KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input == KEY_F(1) || input=='?' )
|
||||
help();
|
||||
@ -284,7 +284,7 @@ int main(int argc,char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<wid-1 && (board[py][px]&RIGHT) )
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if( board[py][px] & CARROT ){
|
||||
++carrots_found;
|
||||
|
@ -579,7 +579,7 @@ int main(int argc,char** argv){
|
||||
|
||||
if( input==KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
prey=py;
|
||||
prex=px;
|
||||
@ -610,7 +610,7 @@ int main(int argc,char** argv){
|
||||
mk_square(board);
|
||||
}
|
||||
DidntMove:
|
||||
if( input=='q'){
|
||||
if( (input=='q'||input==27)){
|
||||
sigint_handler(0);
|
||||
}
|
||||
if( input=='p'){
|
||||
@ -630,7 +630,7 @@ int main(int argc,char** argv){
|
||||
if( input=='?' || input==KEY_F(1)){
|
||||
help();
|
||||
}
|
||||
if( input=='!' || input==KEY_F(2)){
|
||||
if( input=='!' || (input==KEY_F(2)||input=='!')){
|
||||
gameplay();
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ int main(int argc , char** argv){
|
||||
input=getch();
|
||||
if( input==KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input==KEY_MOUSE )
|
||||
mouseinput();
|
||||
@ -407,7 +407,7 @@ int main(int argc , char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<7)
|
||||
++px;
|
||||
if( input=='q'){
|
||||
if( (input=='q'||input==27)){
|
||||
resign=1;
|
||||
goto End;
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ int main(int argc, char** argv){
|
||||
input = getch();
|
||||
if( input == KEY_F(1) || input=='?' )
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( (input=='k' || (input==KEY_UP||input=='w')) && p.y>0 && p.direction != DOWN ){
|
||||
p.direction=UP;
|
||||
@ -720,7 +720,7 @@ int main(int argc, char** argv){
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && p.x<wid-1 && p.direction != LEFT){
|
||||
p.direction=RIGHT;
|
||||
}
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if( input=='p'){
|
||||
nocbreak();
|
||||
|
4
sos.c
4
sos.c
@ -399,7 +399,7 @@ int main(int argc, char** argv){
|
||||
}
|
||||
if( input==KEY_F(1) || input=='?')
|
||||
help();
|
||||
if( input==KEY_F(2) )
|
||||
if( (input==KEY_F(2)||input=='!') )
|
||||
gameplay();
|
||||
if( input==KEY_MOUSE )
|
||||
mouseinput(sy,sx);
|
||||
@ -411,7 +411,7 @@ int main(int argc, char** argv){
|
||||
--px;
|
||||
if( (input=='l' || (input==KEY_RIGHT||input=='d')) && px<wid-1)
|
||||
++px;
|
||||
if( input=='q')
|
||||
if( (input=='q'||input==27))
|
||||
sigint_handler(0);
|
||||
if(!board[py][px] && (input=='s'||input=='S'||input=='o'||input=='O') ){
|
||||
if(input=='s'||input=='S')
|
||||
|
4
sudoku.c
4
sudoku.c
@ -490,7 +490,7 @@ int main(int argc,char** argv){
|
||||
}
|
||||
if(input == KEY_F(1))
|
||||
help();
|
||||
if(input == KEY_F(2))
|
||||
if((input==KEY_F(2)||input=='!'))
|
||||
gameplay();
|
||||
if(input == KEY_MOUSE)
|
||||
mouseinput(sy,sx);
|
||||
@ -508,7 +508,7 @@ int main(int argc,char** argv){
|
||||
else if(input<=CHAR_MAX && sgn2int(input) && sgn2int(input)<=s )
|
||||
game[py][px]=input;
|
||||
}
|
||||
if( (input=='q' && size<= 5) || input=='Q')
|
||||
if( ((input=='q'||input==27) && size<= 5) || input=='Q')
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
if(input=='n'&& size <= 4)
|
||||
goto Start;
|
||||
|
Loading…
Reference in New Issue
Block a user