diff options
Diffstat (limited to 'src/ft_bad_boy_actions.c')
-rw-r--r-- | src/ft_bad_boy_actions.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c index 775e917..eada61a 100644 --- a/src/ft_bad_boy_actions.c +++ b/src/ft_bad_boy_actions.c @@ -43,16 +43,18 @@ void if (FT_OS == 2) { - r_x = (random() % 2 == 1) ? (1) : (-1); - r_y = (random() % 2 == 1) ? (1) : (-1); + r_x = random() % 3; + r_y = random() % 3; } else { - r_x = (rand() % 2 == 1) ? (1) : (-1); - r_y = (rand() % 2 == 1) ? (1) : (-1); + r_x = rand() % 3; + r_y = rand() % 3; } - sl->s_pos_x += (0.1 * r_x); - sl->s_pos_y += (0.1 * r_y); + r_x = (r_x == 2) ? (-1) : (r_x); + r_y = (r_y == 2) ? (-1) : (r_y); + sl->s_pos_x += (FT_MOVE_SPEED * 1.5 * r_x); + sl->s_pos_y += (FT_MOVE_SPEED * 1.5 * r_y); ft_bb_collision(old_y, old_x, sl, ml); ml->map[lround(old_y)][lround(old_x)] = '0'; ml->map[lround(sl->s_pos_y)][lround(sl->s_pos_x)] = 'e'; |