From 04a6703fd66a7d34b2556a9c203c4dada3baca38 Mon Sep 17 00:00:00 2001 From: scratko Date: Fri, 12 Apr 2024 03:17:46 +0300 Subject: Added behavior modes Reverse direction Random direction --- field.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'field.c') diff --git a/field.c b/field.c index add43d1..37a5be1 100644 --- a/field.c +++ b/field.c @@ -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('.'); -- cgit v1.2.3