fixed a couple bugs

This commit is contained in:
david committed 2026-07-28 03:23:28 -03:00
1 parent 64d81da061
commit acb78f0835
3 files changed
+7 -8

No files matched your search

+3 -4
View File
@@ -97,10 +97,9 @@ void gamecatch(){
running = 1;
while (running) {
if(!running){stop();}
int ch = getch();
switch (ch) {
case 'q': case 'Q': stop(); break;
case 'q': case 'Q': running = 0; break;
case 'a': case 'A': case KEY_LEFT:
curs.posx-= 2;
if(curs.posx < 0) curs.posx = width - 6;
@@ -123,7 +122,7 @@ void gamecatch(){
mvwvline(win, 1, width + 1, ACS_VLINE, height);
mvwaddch(win, 0, width + 1, ACS_TTEE);
mvwaddch(win, height + 1, width + 1, ACS_BTEE);
//this should do it
/*this should do it*/
mvwprintw(win, 1, width + 3, "caught: %d/30", howmany);
mvwprintw(win, 2, width + 3, "(catch 30 to win!)");
@@ -143,7 +142,7 @@ void gamecatch(){
droop[i].posx <= curs.posx + 5) {
droop[i].active = 0;
howmany++;
if(howmany == 30){won = 1; running = 0; stop();}
if(howmany == 30){won = 1; running = 0;}
}
}
}
+2 -1
View File
@@ -182,6 +182,7 @@ static char *bignumprint(bignum b) {
snprintf(nice, 32, "%.2lfe3*%d", b.x, b.y);
}
return nice;
free(nice);
}
@@ -279,7 +280,7 @@ void gameclicker(){
int ch;
while((ch = getch()) != ERR){ //drain the whole queue each frame so rapid clicks/keys aren't ignroed
switch (ch) {
case 'q': case 'Q': stop(); break;
case 'q': case 'Q': running = 0; break;
case 'a': cheeses = addmixregbig(cheeses, 50.0); break;
case 'b': cheeses = mulmixregbig(cheeses, 235.2); break;
case KEY_MOUSE: {
+2 -3
View File
@@ -37,7 +37,7 @@ static void stop() {
clear();
refresh();
endwin();
if(won){addstat(&rat.fun); printf("the rat feels less hungry...\n\n");}
if(won){addstat(&rat.fun);}
won = 0;
found = 0;
running = 0;
@@ -270,10 +270,9 @@ void gamemaze(){
running = 1;
while (running) {
if (!running) stop();
int ch = getch();
switch (ch) {
case 'q': case 'Q': stop(); break;
case 'q': case 'Q': running = 0; break;
case 'r': case 'R': properrestart(&curs, &W, &H); break;
case 'a': case 'A': case KEY_LEFT:
if(curs.posx > 0 && !iswall(curs.posy, curs.posx - 1)){