diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-12-27 18:57:42 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-12-27 18:57:42 +0100 |
| commit | 92def83d88b81aab0cd08e44759b8b8d6354b7c3 (patch) | |
| tree | 48eaeeec2499971799a98b034568987761a97f59 /src | |
| parent | 15df457b99268e8ee3d23cc888461453a4c1a25e (diff) | |
work
Diffstat (limited to 'src')
| -rw-r--r-- | src/game.c | 4 | ||||
| -rw-r--r-- | src/map.c | 15 | ||||
| -rw-r--r-- | src/throwables.c | 2 |
3 files changed, 6 insertions, 15 deletions
@@ -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(); @@ -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}; |
