better build system and game over message more better
This commit is contained in:
parent
60455f73d9
commit
307e6a27cb
|
@ -0,0 +1,12 @@
|
|||
NAME= "Curses Bird"
|
||||
|
||||
|
||||
|
||||
build: main.o
|
||||
gcc -o ${NAME} main.o -lcurses
|
||||
|
||||
clean:
|
||||
rm main.o
|
||||
|
||||
fclean: clean
|
||||
${NAME}
|
4
compile
4
compile
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
gcc -lcurses main.c
|
||||
mv a.out cursesBird
|
||||
gcc main.c -lcurses
|
||||
mv a.out cursesBird
|
||||
|
|
13
main.c
13
main.c
|
@ -198,13 +198,20 @@ int checkCol(Map *map)
|
|||
}
|
||||
|
||||
|
||||
|
||||
static int askToReplay()
|
||||
{
|
||||
char ret;
|
||||
move(0,0);
|
||||
int xPos = COLS / 2 - sizeof("You just lose the game with %d point, do you want to replay ?") / 2;
|
||||
|
||||
erase();
|
||||
printw("You just lose the game with %d point, do you want to replay ?\n"
|
||||
"Press Y if you want to try again, N if you don't", score);
|
||||
move(0, xPos);
|
||||
printw("You just lose the game with %d point, do you want to replay ?",
|
||||
score);
|
||||
|
||||
xPos = COLS / 2 - sizeof("Press Y if you want to try again, N if you don't") / 2;
|
||||
move(1, xPos);
|
||||
printw("Press Y if you want to try again, N if you don't");
|
||||
ret = waitForSomething("yYnN");
|
||||
if (ret == 'y' || ret == 'Y')
|
||||
return (1);
|
||||
|
|
Loading…
Reference in New Issue