summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.c4
-rw-r--r--src/map.c15
-rw-r--r--src/throwables.c2
3 files changed, 6 insertions, 15 deletions
diff --git a/src/game.c b/src/game.c
index 41064e4..e5a34be 100644
--- a/src/game.c
+++ b/src/game.c
@@ -66,8 +66,8 @@ void load_map() {
thread_detach(&send_thread);
}
- create_empty_map();
- //load_map_from_file();
+ //create_empty_map();
+ load_map_from_file();
create_objects();
pathfinding_init();
diff --git a/src/map.c b/src/map.c
index 6eba31a..e697673 100644
--- a/src/map.c
+++ b/src/map.c
@@ -224,20 +224,9 @@ void create_empty_map() {
}
for (int x = 0; x < MAP_SIZE_X; x++) {
- map_to_load.objects[50+x] = (object){.active = true, .position = (vec3f){x, 0, 0}, .size = (vec3f){1,1,1}, .type = OBJECT_METAL_WALL_FRONT};
+ map_to_load.objects[x] = (object){.active = true, .position = (vec3f){x, 0, 0}, .size = (vec3f){1,1,1}, .type = OBJECT_METAL_WALL_FRONT};
}
- map_to_load.objects[0] = (object){.active = true, .position = (vec3f){16, 8, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_PLANTBOX1};
-
- map_to_load.objects[1] = (object){.active = true, .position = (vec3f){0, 0, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_COBBLESTONEWALL1};
- map_to_load.objects[2] = (object){.active = true, .position = (vec3f){0, 1, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_COBBLESTONEWALL1};
- map_to_load.objects[3] = (object){.active = true, .position = (vec3f){0, 2, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_COBBLESTONEWALL1};
-
- map_to_load.objects[4] = (object){.active = true, .position = (vec3f){14, 8, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_PLANTBOX1};
- map_to_load.objects[5] = (object){.active = true, .position = (vec3f){14, 12, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_PLANTBOX1};
- map_to_load.objects[6] = (object){.active = true, .position = (vec3f){16, 10, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_PLANTBOX1};
- map_to_load.objects[7] = (object){.active = true, .position = (vec3f){14, 14, 0}, .size = (vec3f){1,1,2}, .type = OBJECT_PLANTBOX1};
-
map_to_load.light_emitters[0] = (light_emitter){.brightness = 1.0f, .position = (vec3f){0, 0, 10}, .range = 20.0f, .active = true};
map_to_load.light_emitters[1] = (light_emitter){.brightness = 1.0f, .position = (vec3f){0, 30, 10}, .range = 20.0f, .active = true};
@@ -448,6 +437,6 @@ inline map_info get_map_info(platform_window* window) {
info.tile_width = get_tile_width(window);
info.tile_height = get_tile_height(window);
info.px_incline = 0.0f; //info.tile_width/3; // info.tile_width/3; // offset*info.tile_width;
- info.px_raised_per_h = info.tile_height/5.0f;
+ info.px_raised_per_h = info.tile_height;
return info;
} \ No newline at end of file
diff --git a/src/throwables.c b/src/throwables.c
index 2ed5133..518502f 100644
--- a/src/throwables.c
+++ b/src/throwables.c
@@ -48,11 +48,13 @@ void throw_throwable(u32 id, throwable_type type, float dirx, float diry) {
switch(type) {
case THROWABLE_GRENADE: {
+ p->throwables.grenades--;
t.sprite = create_sprite(img_grenade_explode, 12, 96, 96, 0.1f);
t.damage = 1500;
t.direction = (vec3f){.x = dirx*1.5f, .y = diry*1.5f, .z = -0.2f};
} break;
case THROWABLE_MOLOTOV: {
+ p->throwables.molotovs--;
t.sprite = create_sprite(img_molotov_explode, 32, 66, 119, 0.04f);
t.damage = 300;
t.direction = (vec3f){.x = dirx*2.5f, .y = diry*2.5f, .z = -0.3f};