aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'map.c')
-rw-r--r--map.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/map.c b/map.c
index 2b10abd..d8b6e1c 100644
--- a/map.c
+++ b/map.c
@@ -1,8 +1,9 @@
#include "map.h"
#include "sprite.h"
#include "standard.h"
+#include "solid.h"
-void init_map(Map* map) {
+void init_map(Map* map, World* world) {
const Sprite* floor, * bricks;
const Bitmap* fbmp, * bbmp;
Bitmap bitmap;
@@ -67,6 +68,36 @@ void init_map(Map* map) {
);
}
+ /* Bounds */
+ new_solid(
+ world,
+ 0,
+ 0,
+ (map_width * map_tile_size) << fbits,
+ map_tile_size << fbits
+ );
+ new_solid(
+ world,
+ 0,
+ ((map_height - 1) * map_tile_size) << fbits,
+ (map_width * map_tile_size) << fbits,
+ map_tile_size << fbits
+ );
+ new_solid(
+ world,
+ 0,
+ 0,
+ map_tile_size << fbits,
+ (map_height * map_tile_size) << fbits
+ );
+ new_solid(
+ world,
+ ((map_width - 1) * map_tile_size) << fbits,
+ 0,
+ map_tile_size << fbits,
+ (map_height * map_tile_size) << fbits
+ );
+
for (i = 0; i < 20; i++) {
x = rand_range(0, map_width - 1) * map_tile_size;
y = rand_range(0, map_height - 1) * map_tile_size;
@@ -77,6 +108,13 @@ void init_map(Map* map) {
y,
&bricks->rect
);
+ new_solid(
+ world,
+ x << fbits,
+ y << fbits,
+ map_tile_size << fbits,
+ map_tile_size << fbits
+ );
}
}