Compare commits

..

No commits in common. "7bb62ba8082a5c0a82f42f2f761bf7b88ac2dfa5" and "0ab04bb603cdc20fafd27ed22a5fb7f3c73224a7" have entirely different histories.

5 changed files with 22 additions and 56 deletions

View File

@ -1,17 +1,14 @@
# --| Syntax for level files |-- # --| Syntax for level files |--
1) **General rules** 1) **General rule**
. each file must be named "room_k" where k is a positive integer 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 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** 2) **Data structure**
below is a detailled list for all block types ; below is a detailled list for all block types ;
each block type (Blocks, Teleporters, Entities) must have the corresponding word directly above it each block type (Blocks, Teleporters, Entities) must have the corresponding word directly above it
not all three keywords have to be written not all three keywords have to be written
*Data-specific structure :* *Data-specific structure :*
``` ```
blocks: blocks:

BIN
bin/back

Binary file not shown.

View File

@ -1,27 +1,17 @@
Blocks : Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128] [-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] // cp1 [-4.0, 10.0, 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 192]
[-4.0, 20.0, 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 192] // cp2
Entities: 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] [-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] [-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] [-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, 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, 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, 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, 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 : Weight :
0 0

Binary file not shown.

View File

@ -41,16 +41,21 @@ bool pPress = false;
unsigned int textures[16]; unsigned int textures[16];
bool paused = false; bool paused = false;
bool hardReset = true;
double oldx, oldy, oldz;
int oldchx, oldchy;
void reset_everything(GLFWwindow *window, int count, char* folder) { void reset_everything(GLFWwindow *window, int count, char* folder) {
oldx = camx; /*hashtbl_free(visited);
oldy = camy; free_proj();
oldz = camz; free_interf();
oldchx = player_chx; free_pool();
oldchy = player_chy;
init_csts();
init_hashtbl();
init_interf(window);
build_all_menus();
init_ent_generator(30);
init_proj();
parse_rooms(count, folder);
interface_set(-1);*/
camx = /*2*room_width*player_chx+*/0.0; camx = /*2*room_width*player_chx+*/0.0;
camy = 5.0; camy = 5.0;
@ -111,19 +116,6 @@ void reset_everything(GLFWwindow *window, int count, char* folder) {
generate_nearby_chunks(1); generate_nearby_chunks(1);
printf("-------------------------------- Done 5 --------------------------------\n"); printf("-------------------------------- Done 5 --------------------------------\n");
if(!hardReset) {
camx = oldx;
camy = oldy;
camz = oldz;
player_chx = oldchx;
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);
}
}
} }
void processInput(GLFWwindow *window, float dtime) { void processInput(GLFWwindow *window, float dtime) {
@ -258,19 +250,6 @@ void processInput(GLFWwindow *window, float dtime) {
if(glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS) { if(glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS) {
if(!isMenuOpen() && !rPress) { if(!isMenuOpen() && !rPress) {
rPress = true; rPress = true;
hardReset = true;
//reset_everything(window, 4, "levels/level_00/");
//reset_everything(window, 7, "levels/level_01/");
reset_everything(window, 1, "levels/level_02/");
}
} else {
rPress = false;
}
if(glfwGetKey(window, GLFW_KEY_T) == GLFW_PRESS) {
if(!isMenuOpen() && !rPress) {
rPress = true;
hardReset = false;
//reset_everything(window, 4, "levels/level_00/"); //reset_everything(window, 4, "levels/level_00/");
//reset_everything(window, 7, "levels/level_01/"); //reset_everything(window, 7, "levels/level_01/");
reset_everything(window, 1, "levels/level_02/"); reset_everything(window, 1, "levels/level_02/");