diff options
author | scratko <m@scratko.xyz> | 2024-04-12 03:17:46 +0300 |
---|---|---|
committer | scratko <m@scratko.xyz> | 2024-04-12 03:17:46 +0300 |
commit | 04a6703fd66a7d34b2556a9c203c4dada3baca38 (patch) | |
tree | 3d2cbdaae515d90747e507ba8a8ebfd7bdc44fed /field.c | |
parent | 235f8481502263fcdb4823ff0bc4e8f831bc934d (diff) | |
download | pacman-04a6703fd66a7d34b2556a9c203c4dada3baca38.tar.gz pacman-04a6703fd66a7d34b2556a9c203c4dada3baca38.tar.bz2 pacman-04a6703fd66a7d34b2556a9c203c4dada3baca38.zip |
Added behavior modes
Reverse direction
Random direction
Diffstat (limited to 'field.c')
-rw-r--r-- | field.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -8,7 +8,7 @@ static const char field_sample[field_height][field_width] = { {"////////////////////////////"}, {"/1....2.....1//1.....2....1/"}, {"/.////./////.//./////.////./"}, - {"/./ /./ /.//./ /./ /./"}, + {"/*/ /./ /.//./ /./ /*/"}, {"/./ /./ /.//./ /./ /./"}, {"/.////./////.//./////.////./"}, {"/2....3..2..2..2..2..3....2/"}, @@ -26,7 +26,7 @@ static const char field_sample[field_height][field_width] = { {"//////.// //////// //.//////"}, {"/1....3..2..1//1..2..3....1/"}, {"/.////./////.//./////.////./"}, - {"/.////./////.//./////.////./"}, + {"/*////./////.//./////.////*/"}, {"/1.1//2..2..y..y..2..2//1.1/"}, {"///.//.//.////////.//.//.///"}, {"///.//.//.////////.//.//.///"}, @@ -70,21 +70,24 @@ void print_field(game_space field) symbol = field[i][j]; move(i, j); switch(symbol) { - case '1': - case '2': - case '3': + case one_path: + case two_paths: + case three_paths: if(field_has_coin(i, j)) addch('.'); else addch(' '); break; - case '/': + case block: addch('/'); break; - case '.': + case coin: addch('.'); break; - case '#': + case energizer: + addch('*'); + break; + case door: addch('#'); break; } @@ -138,6 +141,7 @@ void clear_or_revert_symbol(game_space field, struct coordinates position, case door: addch('#'); break; + case energizer: case coin: queue_consists_point(eaten_coins, position) ? addch(' ') : addch('.'); |