diff options
| author | Ray Hogenson <rayhogenson@gmail.com> | 2012-03-26 15:35:21 -0800 |
|---|---|---|
| committer | Ray Hogenson <rayhogenson@gmail.com> | 2012-03-26 15:35:21 -0800 |
| commit | d14fe2cacf42657ed2ddbe80fa0c372e1adfd201 (patch) | |
| tree | 38f8dfdca7a1af13208313dec97f73b860d23587 | |
| parent | adc79032764885b4701e33a874487ebd74d9657d (diff) | |
| download | yetihack-d14fe2cacf42657ed2ddbe80fa0c372e1adfd201.tar.zst | |
added a help menu
| -rw-r--r-- | os/windows/Makefile | 2 | ||||
| -rw-r--r-- | src/YetiHack.cpp | 35 |
2 files changed, 34 insertions, 3 deletions
diff --git a/os/windows/Makefile b/os/windows/Makefile index b617610..e078d8e 100644 --- a/os/windows/Makefile +++ b/os/windows/Makefile @@ -1,5 +1,5 @@ yetihack.exe: src/YetiHack.cpp src/yeti.cpp - i486-mingw32-g++ src/YetiHack.cpp src/yeti.cpp -o src/yetihack.exe -L . -lpdcurses -Iinclude -static-libgcc -static-libstdc++ + i486-mingw32-g++ src/YetiHack.cpp src/yeti.cpp -o src/yetihack.exe -L os/windows/yetihack-windows/pdcurses.dll -static -lpdcurses -Iinclude -static-libgcc -static-libstdc++ -rm os/windows/yetihack-windows/yetihack.exe ln src/yetihack.exe os/windows/yetihack-windows/ diff --git a/src/YetiHack.cpp b/src/YetiHack.cpp index c49cc9f..41a4d63 100644 --- a/src/YetiHack.cpp +++ b/src/YetiHack.cpp @@ -19,6 +19,7 @@ bool smessage(int, string); vector<int> turns(int); const char* convert(int); void menu(bool); +void help(); void endCurses() { @@ -326,11 +327,12 @@ const char* convert(int a) void menu(bool immortal) { int a = 100; - startCurses(); + erase(); char input; addstr("Welcome to yetihack!\n"); addstr("\t1. Arcade mode (classic)\n"); addstr("\t2. Story mode\n"); + addstr("\t3. Help\n"); addstr("Select an option to proceed: "); refresh(); echo(); @@ -378,10 +380,35 @@ void menu(bool immortal) erase(); story(); break; + case '3': + erase(); + help(); + break; } addstr(convert(a)); } +void help() +{ + addstr("To begin, choose story mode.\n"); + addstr("Then, enjoy the first story prompt.\n"); + addstr("You are the @.\n"); + addstr("Move the @ with the number pad.\n"); + addstr("Note that num lock must be on to move the @\n"); + addstr("Avoid the y characters, they are yetis.\n"); + addstr("New yetis will spawn every once in a while.\n"); + addstr("At the beginning of each round, a message will tell you how many turns you need to survive.\n"); + addstr("After that, press enter to go to the next round.\n"); + addstr("Good luck.\n"); + addstr("Press enter to return to the menu.\n"); + refresh(); + char input; + do + { + input = getch(); + } while (input != '\n'); +} + int main(int argc, char* argv[]) { /*startCurses(); @@ -391,13 +418,17 @@ int main(int argc, char* argv[]) int a = input; addstr(convert(a)); }*/ + startCurses(); bool immortal = false; if (argc > 1 && strcmp(argv[1],"-c") == 0) { immortal = true; } srand(time(0)); - menu(immortal); + while(true) + { + menu(immortal); + } endCurses(); return 0; } |
