diff --git a/README.md b/README.md index 95a25f5..8816d3a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # --| Syntax for level files |-- - -1) **General rule** -each file must be named "room_k" where k is a positive integer -if "room_k" exists then all "room_u" where 0 <= u < k exists - + +1) **General rules** +. each file must be named "room_k" where k is a positive integer + if "room_k" exists then all "room_u" where 0 <= u < k exists + +. you can add text at the end of each line as comments + but *do not use caps*, *this might confuse the parser* + 2) **Data structure** below is a detailled list for all block types ; each block type (Blocks, Teleporters, Entities) must have the corresponding word directly above it not all three keywords have to be written - + *Data-specific structure :* ``` blocks: diff --git a/bin/back b/bin/back index 1de4c39..16eaa1a 100755 Binary files a/bin/back and b/bin/back differ diff --git a/levels/level_02/room_0 b/levels/level_02/room_0 index b17155b..9f84dd5 100644 --- a/levels/level_02/room_0 +++ b/levels/level_02/room_0 @@ -1,17 +1,27 @@ Blocks : [-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128] -[-4.0, 10.0, 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 192] +[-4.0, 10.0, 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 192] // cp1 +[-4.0, 20.0, 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 192] // cp2 Entities: [-2.0, 1.0 , -2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 128, 1, 0, 8, 100, 1, 128, 128, 128] [-1.5, 1.5 , -1.5, 1.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192, 1, 0, 7, levels/level_01/, 7, great, 192, 192, 192] -[-8.0, 0.0, -8.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 1] + +[-3.5, 13.0, 0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 10, 0, 0] // cp1 coin +[-3.5, 23.0, 0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 10, 0, 0] // cp2 coin + +[-8.0, 0.0, -8.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 1] // section 1 (beat) [-6.0, 2.0, -8.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 1] [-4.0, 4.0, -8.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 0] [-4.0, 6.0, -6.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 0] [-4.0, 8.0, -4.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 1] [-4.0, 10.0, -2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 0, 9, 2.0, 2.0, 1] -[-4.0, 11.0, 7.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 0.0, 5.0, 0.0, 0.0, 5.0] + +[-4.0, 11.0, 7.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 0.0, 5.0, 0.0, 0.0, 5.0] // section 2 (lines) +[ 1.0, 11.0, 14.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 5.0, 0.0, 0.0, -5.0, 0.0, 0.0] +[ 8.0, 16.0, 14.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 5.0, 0.0, 0.0, 5.0, 4.0] +[-4.0, 21.0, 7.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 0.0, 5.0, 0.0, 0.0, -5.0] +[ 1.0, 21.0, 14.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 5.0, 0.0, 0.0, 5.0, 0.0, 0.0] Weight : 0 diff --git a/obj/main.o b/obj/main.o index 1839a40..bbd16ce 100644 Binary files a/obj/main.o and b/obj/main.o differ diff --git a/src/main.c b/src/main.c index 62f800c..e97ab67 100644 --- a/src/main.c +++ b/src/main.c @@ -120,6 +120,9 @@ void reset_everything(GLFWwindow *window, int count, char* folder) { player_chy = oldchy; generate_nearby_chunks(1); current_room = hashtbl_find_opt(visited, player_chx, player_chy); + if(current_room == NULL) { + current_room = hashtbl_find_opt(visited, 0, 0); + } } }