1
0
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:
me 2022-02-02 16:09:13 +03:30
parent aaf092d106
commit 2199c6efd3
17 changed files with 34 additions and 34 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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()) )

View File

@ -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) )

View File

@ -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){

View File

@ -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){

View File

@ -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();

View File

@ -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;

View File

@ -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());

View File

@ -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;

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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
View File

@ -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')

View File

@ -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;