add macros

This commit is contained in:
quenousimporte 2025-03-31 10:23:13 +00:00
parent 66fc645582
commit 715437078a
1 changed files with 4 additions and 2 deletions

6
w/w.c
View File

@ -10,6 +10,8 @@
#define CMD_NULL "-"
#define CMD_FWD 's'
#define CMD_ATTACK 'a'
#define CMD_FLEE 'f'
#define SC_TITLE 0
#define SC_SETNAME 1
@ -470,11 +472,11 @@ void update(char command[CMD_LEN])
}
else if (state.screen == SC_MONSTER)
{
if (c == 'f')
if (c == CMD_FLEE)
{
state.screen = SC_MAP;
}
else if (c == 'a')
else if (c == CMD_ATTACK)
{
// hero then monster turn.
// possible outcomes: hero dead, monster dead, or still fight