diff options
-rw-r--r-- | xd.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -4278,23 +4278,34 @@ static void SnowDemo(void) for(f = 0; f < SNOW_FLAKES; f++) { + int dir; + + if (RND(10) > 5) + { + dir = 1; + } + else + { + dir = -1; + } + if (map[XY(snow[f].x, snow[f].y + 1)] == 0) { Plot(snow[f].x, snow[f].y, black); snow[f].y++; Plot(snow[f].x, snow[f].y, white); } - else if (map[XY(snow[f].x + 1, snow[f].y + 1)] == 0) + else if (map[XY(snow[f].x + dir, snow[f].y + 1)] == 0) { Plot(snow[f].x, snow[f].y, black); - snow[f].x++; + snow[f].x += dir; snow[f].y++; Plot(snow[f].x, snow[f].y, white); } - else if (map[XY(snow[f].x - 1, snow[f].y + 1)] == 0) + else if (map[XY(snow[f].x - dir, snow[f].y + 1)] == 0) { Plot(snow[f].x, snow[f].y, black); - snow[f].x--; + snow[f].x -= dir; snow[f].y++; Plot(snow[f].x, snow[f].y, white); } |