-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.c
More file actions
63 lines (60 loc) · 1.8 KB
/
instructions.c
File metadata and controls
63 lines (60 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#define NUMPAGES 2
int page = 1;
char instructionsText1[] = {"\
Page 1: Introduction\n\
----------------\n\
(Use the up and down arrow keys to scroll between pages of instructions)\n\n\
This is you: U\n\
More specifically, this is your when facing up. When facing down, you look more\n\
like this: D And, as you can probably imagine, left and right look like L & R,\n\
respectively.\n\n\
Your name is Chad, by the way. Huh? What's that you say?\n\n\
\"Chad? Really now? What kind of name for a hero is Chad?\"\n\n\
Well, I can't really argue with you. It is a terrible name. But, that's just\n\
the way it is, so try to deal with it.\n\n\
Anyway, Chad, erm, I mean YOU (remember, you ARE the Chad), work in the local\n\
Amazon warehouse, stacking boxes, taking inventory, etc. That is, you did until\n\
one day, when a co-woker informs you that your boss, Sigmeund Freud wants to\n\
have a word with you. You head to his office to see what's up..."
};
char instructionsText2[] = {"\
Page 2: Controls\n\
----------------\n\n\
Use the arrow keys for navigation, both in the game world and in the menus.\n\
The 'z' key is used to to select menu options and talk to npcs, think of it\n\
like the 'A' button on a Gameboy. Conversely, the 'x' key is used to back out\n\
of menus and selections, like the 'B' button on a gameboy. When in the main\n\
game use the TAB key to open and close the pause menu."
};
void updateInstructions(int key)
{
switch(key)
{
case KEY_UP:
if(page > 1) page--;
break;
case KEY_DOWN:
if(page < NUMPAGES) page++;
break;
case 'x':
setState(getPrevState());
break;
case 27:
setState(QUIT);
break;
default:
break;
}
}
void renderInstructions()
{
switch(page)
{
case 1:
mvaddstr(0,0, instructionsText1);
break;
case 2:
mvaddstr(0,0, instructionsText2);
break;
}
}