aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'map.c')
-rw-r--r--map.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/map.c b/map.c
index d8b6e1c..b9eb0ac 100644
--- a/map.c
+++ b/map.c
@@ -7,13 +7,13 @@ void init_map(Map* map, World* world) {
const Sprite* floor, * bricks;
const Bitmap* fbmp, * bbmp;
Bitmap bitmap;
- int i, x, y;
+ int i, x, y, r;
bitmap.pixels = map->pixels;
bitmap.w = mbmp_w;
bitmap.h = mbmp_h;
- floor = get_sprite(sprite_floor_tile);
+ floor = get_sprite(sprite_floor_tile_1);
bricks = get_sprite(sprite_bricks);
fbmp = get_bitmap(floor->bitmap);
bbmp = get_bitmap(bricks->bitmap);
@@ -22,8 +22,12 @@ void init_map(Map* map, World* world) {
bitmap.pixels[i] = make_black();
}
- for (x = 1; x < map_width - 1; x++) {
- for (y = 1; y < map_height - 1; y++) {
+ for (y = 1; y < map_height - 1; y++) {
+ for (x = 1; x < map_width - 1; x++) {
+ r = rng() % 60;
+ if (r > 50) {
+ floor = get_sprite((r % 4) + sprite_floor_tile_1);
+ }
blit(
&bitmap,
fbmp,