diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f4f738 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ + +blocks: + [x, y, z, w, h, d, rhz, rvt, r, g, b] + +teleporters: + [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] + +entities: + [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] + // Entity types are : + // 0 (coin) -> damage equals the coin's value + // 1 (still explosive) + // 2 (seeking explosive) + // 3 (shooting still explosive) + // if entityType = 4 (moving platform) + [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with + amplitude_{x,y,z} = double[>= 0.0] + {mult,divd} = int + {phase} = int[0, 360] + + // else if entityType = 5 (linear moving platform) + [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with + amplitude_{x,y,z} = double[>= 0.0] + speed_{x,y,z} = double + + // else if entityType = 6 (text box) + [.. text, tred, tgreen, tblue] with + text = {char*} + + // else if entityType = 7 (warp text box) + [.. dest_folder, room_count, text, tred, tgreen, tblue] with + {dest_folder,text} = {char*} (length <= 50) + {r,g,b} = int[0-256] + + + // else if entityType = 8 (lock box) + [.. cost, doPay, tred, tgreen, tblue] with + cost = int[> 0] (0 breaks) + doPay = {0, 1} (bool) + + else + [..] \ No newline at end of file diff --git a/bin/back b/bin/back index b81e18c..c4431da 100755 Binary files a/bin/back and b/bin/back differ diff --git a/levels/level_00/room_0 b/levels/level_00/room_0 index c9199f2..e013206 100644 --- a/levels/level_00/room_0 +++ b/levels/level_00/room_0 @@ -18,50 +18,4 @@ Entities: Weight : 0 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> HP equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - - // else if entityType = 9 (beat block) - [.. time_on, time_off, start] with - time_{on,off} = double[>0.0] - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_00/room_1 b/levels/level_00/room_1 index 792f811..7c188f3 100644 --- a/levels/level_00/room_1 +++ b/levels/level_00/room_1 @@ -12,34 +12,4 @@ Entities: Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - else if entityType = 6 (text box) - [.. text] with - text = {char*} - - else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, r, g, b] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_00/room_2 b/levels/level_00/room_2 index 0e287f4..c30dada 100644 --- a/levels/level_00/room_2 +++ b/levels/level_00/room_2 @@ -15,39 +15,4 @@ Entities: Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_00/room_3 b/levels/level_00/room_3 index d65d772..3da1dc1 100644 --- a/levels/level_00/room_3 +++ b/levels/level_00/room_3 @@ -7,34 +7,4 @@ Entities : Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - else if entityType = 6 (text box) - [.. text] with - text = {char*} - - else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, r, g, b] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_0 b/levels/level_01/room_0 index b2e0772..b5e4132 100644 --- a/levels/level_01/room_0 +++ b/levels/level_01/room_0 @@ -7,53 +7,12 @@ Blocks : [13.0, 0.0, -1.0, 2.0, 10.0, 2.0, 0.0, 0.0, 128, 128, 128] Entities: -[-1.0, 15.0, -1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 10, 0] -[2.0 , 0.0 , 2.0 , 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0 , 6, hope you like parkour, 255, 192, 192] -[-2.0, 1.0 , -2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 128, 1, 0 , 8, 50, 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.0, 15.0, -1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 10, 0, 0] +[2.0 , 0.0 , 2.0 , 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1 , 0, 6, hope you like parkour, 255, 192, 192] +[-2.0, 1.0 , -2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 128, 1 , 0, 8, 50, 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_02/, 1, great, 192, 192, 192] Weight : 0 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_1 b/levels/level_01/room_1 index a079c01..667c273 100644 --- a/levels/level_01/room_1 +++ b/levels/level_01/room_1 @@ -9,10 +9,10 @@ Blocks : [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] Entities : -[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] +[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] [-1.0, 1.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 5, 0.0, 0.0, 13.7, 0.0, 0.0, 12.0] [-1.0, 15.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 5, 0.0, 0.0, 13.7, 0.0, 0.0, 12.5] [-14.0, 7.5, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 7.5, 0.0, 0.0, 10.0, 0.0] @@ -21,45 +21,4 @@ Entities : Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_2 b/levels/level_01/room_2 index 39089bc..2f9f00c 100644 --- a/levels/level_01/room_2 +++ b/levels/level_01/room_2 @@ -9,10 +9,10 @@ Blocks : [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] Entities : -[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] +[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] [-1.0, 1.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 5, 13.7, 0.0, 0.0, 12.0, 0.0, 0.0] [-1.0, 15.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 5, 13.7, 0.0, 0.0, 12.5, 0.0, 0.0] [-1.0, 7.5, -14.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 5, 0.0, 7.5, 0.0, 0.0, 10.0, 0.0] @@ -21,45 +21,4 @@ Entities : Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_3 b/levels/level_01/room_3 index c025689..7a27f77 100644 --- a/levels/level_01/room_3 +++ b/levels/level_01/room_3 @@ -9,10 +9,10 @@ Blocks : [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] Entities : -[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] +[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] [-1.0, 1.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 4, 0.0, 0.0, 13.7, 1, 1, 0] [-1.0, 15.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 4, 0.0, 0.0, 13.7, 1, 1, 180] [-14.0, 7.5, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 4, 0.0, 7.5, 0.0, 4, 3, 90] @@ -21,45 +21,4 @@ Entities : Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_4 b/levels/level_01/room_4 index 9999e34..49f394a 100644 --- a/levels/level_01/room_4 +++ b/levels/level_01/room_4 @@ -9,10 +9,10 @@ Blocks : [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] Entities : -[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] -[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 1, 2, 0] +[-2.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, -2.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[-2.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] +[ 1.0, 16.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0] [-1.0, 1.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 4, 13.7, 0.0, 0.0, 1, 1, 0] [-1.0, 15.0, -1.0, 2.0, 1.0, 2.0, 0.0, 0.0, 128, 128, 128, 1, 0, 4, 13.7, 0.0, 0.0, 1, 1, 180] [-1.0, 7.5, -14.0, 2.0, 1.0, 2.0, 0.0, 0.0, 192, 192, 192, 1, 0, 4, 0.0, 7.5, 0.0, 4, 3, 90] @@ -21,45 +21,4 @@ Entities : Weight : 50 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_5 b/levels/level_01/room_5 index 71ff713..d27222c 100644 --- a/levels/level_01/room_5 +++ b/levels/level_01/room_5 @@ -17,45 +17,4 @@ Entities : Weight : 75 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_01/room_6 b/levels/level_01/room_6 index 24725e2..8dcee1c 100644 --- a/levels/level_01/room_6 +++ b/levels/level_01/room_6 @@ -21,45 +21,4 @@ Entities : Weight : 75 -$ -blocks: - [x, y, z, w, h, d, rhz, rvt, r, g, b] - -teleporters: - [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] - -entities: - [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] - // Entity types are : - // 0 (coin) -> damage equals the coin's value - // 1 (still explosive) - // 2 (seeking explosive) - // 3 (shooting still explosive) - // if entityType = 4 (moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with - amplitude_{x,y,z} = double[>= 0.0] - {mult,divd} = int - {phase} = int[0, 360] - - // else if entityType = 5 (linear moving platform) - [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with - amplitude_{x,y,z} = double[>= 0.0] - speed_{x,y,z} = double - - // else if entityType = 6 (text box) - [.. text, tred, tgreen, tblue] with - text = {char*} - - // else if entityType = 7 (warp text box) - [.. dest_folder, room_count, text, tred, tgreen, tblue] with - {dest_folder,text} = {char*} (length <= 50) - {r,g,b} = int[0-256] - - - // else if entityType = 8 (lock box) - [.. cost, doPay, tred, tgreen, tblue] with - cost = int[> 0] (0 breaks) - doPay = {0, 1} (bool) - - else - [..] \ No newline at end of file +$ \ No newline at end of file diff --git a/levels/level_02/room_0 b/levels/level_02/room_0 new file mode 100644 index 0000000..fbf1808 --- /dev/null +++ b/levels/level_02/room_0 @@ -0,0 +1,59 @@ +Blocks : +[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128] +[-5.0, 13.0, -5.0, 10.0, 1.0, 10.0, 0.0, 0.0, 255, 255, 255] +[-1.0, 0.0, -15.0, 2.0, 10.0, 2.0, 0.0, 0.0, 128, 128, 128] +[-1.0, 0.0, 13.0, 2.0, 10.0, 2.0, 0.0, 0.0, 128, 128, 128] +[-15.0, 0.0, -1.0, 2.0, 10.0, 2.0, 0.0, 0.0, 128, 128, 128] +[13.0, 0.0, -1.0, 2.0, 10.0, 2.0, 0.0, 0.0, 128, 128, 128] + +Entities: +[-1.0, 15.0, -1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 10, 0, 0] +[2.0 , 0.0 , 2.0 , 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1 , 0, 6, hope you like parkour, 255, 192, 192] +[-2.0, 1.0 , -2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 128, 1 , 0, 8, 50, 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] + +Weight : +0 + +$ +blocks: + [x, y, z, w, h, d, rhz, rvt, r, g, b] + +teleporters: + [x, y, z, w, h, d, rhz, rvt, r, g, b, dest_chx, dest_chy] + +entities: + [x, y, z, w, h, d, rhz, rvt, r, g, b, hp, damage, entityType ..] + // Entity types are : + // 0 (coin) -> damage equals the coin's value + // 1 (still explosive) + // 2 (seeking explosive) + // 3 (shooting still explosive) + // if entityType = 4 (moving platform) + [.. amplitude_x, amplitude_y, amplitude_z, mult, divd, phase] with + amplitude_{x,y,z} = double[>= 0.0] + {mult,divd} = int + {phase} = int[0, 360] + + // else if entityType = 5 (linear moving platform) + [.. amplitude_x, amplitude_y, amplitude_z, speed_x, speed_y, speed_z] with + amplitude_{x,y,z} = double[>= 0.0] + speed_{x,y,z} = double + + // else if entityType = 6 (text box) + [.. text, tred, tgreen, tblue] with + text = {char*} + + // else if entityType = 7 (warp text box) + [.. dest_folder, room_count, text, tred, tgreen, tblue] with + {dest_folder,text} = {char*} (length <= 50) + {r,g,b} = int[0-256] + + + // else if entityType = 8 (lock box) + [.. cost, doPay, tred, tgreen, tblue] with + cost = int[> 0] (0 breaks) + doPay = {0, 1} (bool) + + else + [..] \ No newline at end of file diff --git a/obj/display.o b/obj/display.o index 0838894..2b3cbf2 100644 Binary files a/obj/display.o and b/obj/display.o differ diff --git a/obj/entities.o b/obj/entities.o index 3d14dd2..252916b 100644 Binary files a/obj/entities.o and b/obj/entities.o differ diff --git a/obj/generation.o b/obj/generation.o index 749e71b..a70f5c8 100644 Binary files a/obj/generation.o and b/obj/generation.o differ diff --git a/obj/hash.o b/obj/hash.o index d67ae10..1d7d5e3 100644 Binary files a/obj/hash.o and b/obj/hash.o differ diff --git a/obj/main.o b/obj/main.o index 6833c56..a0b5add 100644 Binary files a/obj/main.o and b/obj/main.o differ diff --git a/obj/menus.o b/obj/menus.o index c58d29a..352e91f 100644 Binary files a/obj/menus.o and b/obj/menus.o differ diff --git a/obj/move.o b/obj/move.o index 0f7f452..d6b06a0 100644 Binary files a/obj/move.o and b/obj/move.o differ diff --git a/res/beat_off.png b/res/beat_off.png index fdae684..c064e5f 100644 Binary files a/res/beat_off.png and b/res/beat_off.png differ diff --git a/res/beat_on.png b/res/beat_on.png index b611c00..88acfc7 100644 Binary files a/res/beat_on.png and b/res/beat_on.png differ diff --git a/src/entities.c b/src/entities.c index 4882b40..24983c9 100644 --- a/src/entities.c +++ b/src/entities.c @@ -123,6 +123,18 @@ void moving_xyz_line(double x, double y, double z, double w, double h, double d, } } + + +// metai1 = id of the interface +// metai2 = price +// metai3 = doPay +// metach1 = text (stored here to free() easily) +void subtitle_text_box(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret) { + if(distance_pt_cube_0_3d_infinite(camx, camy, camz, ret) <= 1.5) { + gl_drawString(fShader, ent->metach1, 0.0f, -0.7f, 0.03f, ret->red, ret->green, ret->blue, 0.003f, 0); + } +} + // metad1 = time ON // metad2 = time OFF // metad3 = current time left @@ -237,7 +249,7 @@ void pop_and_tp(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) { // metach1 = text (stored here to free() easily) void locker(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) { //printf("%d %d %d <<<<\n", ent->metai1, ent->metai2, ent->metai3); - interface_set(ent->metai1); + //interface_set(ent->metai1); if(coins >= ent->metai2) { if(ent->metai3) { coins -= ent->metai2; diff --git a/src/entities.h b/src/entities.h index 1e699d6..67e68a6 100644 --- a/src/entities.h +++ b/src/entities.h @@ -15,6 +15,7 @@ void speen3(double x, double y, double z, double w, double h, double d, double h void moving_xyz(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret); void moving_xyz_line(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret); void go_to_player(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret); +void subtitle_text_box(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret); void beating_block(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, entity* ent, cube_0* ret); void detectHit(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret); diff --git a/src/generation.c b/src/generation.c index 355b583..3c5a447 100644 --- a/src/generation.c +++ b/src/generation.c @@ -27,6 +27,8 @@ int total_weight; int coins; int fct_entry_size; +bool is_one_room; + static char** to_free; static int to_length; @@ -106,9 +108,9 @@ void init_ent_generator(int n) { hashtbl_entities[8].id = 8; hashtbl_entities[8].tex = 7; - hashtbl_entities[7].tex2 = 7; + hashtbl_entities[8].tex2 = 7; hashtbl_entities[8].name = "Lock"; - hashtbl_entities[8].updatePos = NULL; + hashtbl_entities[8].updatePos = &subtitle_text_box; hashtbl_entities[8].onHit = &locker; hashtbl_entities[8].onDeath = NULL; @@ -586,7 +588,7 @@ void parse_one_room(int id, char* filename) { msg[ki] = '\0'; // k=18 if singlt digit - pool[id].area->ents[k]->metai1 = build_text_box(msg, ired, igreen, iblue); + //pool[id].area->ents[k]->metai1 = build_text_box(msg, ired, igreen, iblue); pool[id].area->ents[k]->metai2 = cost; pool[id].area->ents[k]->metai3 = doPay; pool[id].area->ents[k]->metach1 = msg; @@ -678,6 +680,14 @@ void parse_rooms(int n_rooms, char* folder) { free(name); printf("Total sum : %d\n", total_weight); + if(total_weight == 0) { + // avoid floating point exception + total_weight = 1; + is_one_room = true; + } else { + is_one_room = false; + } + generate_nearby_chunks(0); current_room = hashtbl_find_opt(visited, player_chx, player_chy); } @@ -719,16 +729,18 @@ void generate_nearby_chunks(int render_dist) { if(!hashtbl_mem(visited, player_chx + w, player_chy + h)) { printf("generating (%d, %d)... ", player_chx + w, player_chy + h); fflush(stdout); //build_starting_chunk(player_chx + w, player_chy + h); - int pick = rand()%total_weight; + int pick = rand()%(abs(total_weight)); if(w == 0 && h == 0) { // 1st room will always be room_0 pick = -1; } printf("R = %d ", pick); fflush(stdout); int sum = 0; + bool has_spawned = false; for(int k = 0; k < pool_size; k++) { sum += pool[k].weight; if(pick < sum) { printf("chose %d\n", k); fflush(stdout); + has_spawned = true; room* new = malloc(sizeof(room)); copy_room(pool[k].area, new, player_chx + w, player_chy + h); //generate_terrain(new); @@ -736,6 +748,10 @@ void generate_nearby_chunks(int render_dist) { k = pool_size+1; } } + if(!has_spawned) { + printf("chose NULL\n"); fflush(stdout); + hashtbl_add(visited, player_chx + w, player_chy + h, NULL); + } printf("Done\n"); } } diff --git a/src/hash.c b/src/hash.c index c1f479b..5b90f56 100644 --- a/src/hash.c +++ b/src/hash.c @@ -57,23 +57,25 @@ void linkedList_add(linkedList lst, int chx, int chy, room* area) { } void free_all_cubes(room* r) { - for(int k = 0; k < r->map_size; k++) { - free(r->map[k]); + if(r != NULL) { + for(int k = 0; k < r->map_size; k++) { + free(r->map[k]); + } + for(int k = 0; k < r->tps_size; k++) { + free(r->tps[k]->hitbox); + free(r->tps[k]); + } + for(int k = 0; k < r->ent_memlen; k++) { + //free(r->ents[k]->metach1); + //free(r->ents[k]->metach2); + free(r->ents[k]->hitpoints); + free(r->ents[k]->pos); + free(r->ents[k]); + } + free(r->ents); + free(r->tps); + free(r->map); } - for(int k = 0; k < r->tps_size; k++) { - free(r->tps[k]->hitbox); - free(r->tps[k]); - } - for(int k = 0; k < r->ent_memlen; k++) { - //free(r->ents[k]->metach1); - //free(r->ents[k]->metach2); - free(r->ents[k]->hitpoints); - free(r->ents[k]->pos); - free(r->ents[k]); - } - free(r->ents); - free(r->tps); - free(r->map); } void linkedList_free(linkedList lst) { diff --git a/src/main.c b/src/main.c index 2b7dd1b..82d2304 100644 --- a/src/main.c +++ b/src/main.c @@ -246,8 +246,9 @@ void processInput(GLFWwindow *window, float dtime) { if(glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS) { if(!isMenuOpen() && !rPress) { rPress = true; - //reset_everything(window, 4, "levels/level_00/"); reset_everything(window, 4, "levels/level_00/"); + //reset_everything(window, 7, "levels/level_01/"); + //reset_everything(window, 1, "levels/level_02/"); } } else { rPress = false; @@ -443,8 +444,8 @@ int main_alt() { generate_texture(5, "res/steel.jpeg", JPEG); generate_texture(6, "res/gateway.jpeg", JPEG); generate_texture(7, "res/lock.png", PNG); - generate_texture(8, "res/beat_on.png", PNG); - generate_texture(9, "res/beat_off.png", PNG); + generate_texture(8, "res/beat_on.png", JPG); + generate_texture(9, "res/beat_off.png", JPG); printf("-----------------------------------------------------------------------------------------------\n"); fflush(stdout); diff --git a/src/move.c b/src/move.c index 1cddb73..380cc87 100644 --- a/src/move.c +++ b/src/move.c @@ -265,7 +265,7 @@ bool is_colliding(float dtime) { remove_entity(current_room->ents, ¤t_room->ent_memlen, ¤t_room->ent_len, k); } } - if(updateForces) { + if(updateForces && current_room->ents[k]->entity_type != 0) { updateF(current_room->ents[k]->pos, (double)dtime); } if(current_room->ents[k]->entity_type == 9) { @@ -339,24 +339,32 @@ void movePlayerG(float dtime) { void teleport_on_edge() { if(camx >= room_width) { - camx -= 2.0*room_width; - player_chx += 1; - current_room = hashtbl_find_opt(visited, player_chx, player_chy); - resetProj(); + if(!is_one_room) { + camx -= 2.0*room_width; + player_chx += 1; + current_room = hashtbl_find_opt(visited, player_chx, player_chy); + resetProj(); + } } else if(camx <= -room_width) { - camx += 2.0*room_width; - player_chx -= 1; - current_room = hashtbl_find_opt(visited, player_chx, player_chy); - resetProj(); + if(!is_one_room) { + camx += 2.0*room_width; + player_chx -= 1; + current_room = hashtbl_find_opt(visited, player_chx, player_chy); + resetProj(); + } } else if(camz >= room_depth) { - camz -= 2.0*room_depth; - player_chy += 1; - current_room = hashtbl_find_opt(visited, player_chx, player_chy); - resetProj(); + if(!is_one_room) { + camz -= 2.0*room_depth; + player_chy += 1; + current_room = hashtbl_find_opt(visited, player_chx, player_chy); + resetProj(); + } } else if(camz <= -room_depth) { - camz += 2.0*room_depth; - player_chy -= 1; - current_room = hashtbl_find_opt(visited, player_chx, player_chy); - resetProj(); + if(!is_one_room) { + camz += 2.0*room_depth; + player_chy -= 1; + current_room = hashtbl_find_opt(visited, player_chx, player_chy); + resetProj(); + } } } \ No newline at end of file diff --git a/src/structure.h b/src/structure.h index 95dbc6e..6506565 100644 --- a/src/structure.h +++ b/src/structure.h @@ -166,6 +166,7 @@ extern double fz; extern int njumps; extern unsigned int fffff; +extern unsigned int fShader; extern int gamemode; extern float incr; @@ -182,6 +183,8 @@ extern int loc_proj; extern int loc_frag; extern int loc_tex; +extern bool is_one_room; + extern unsigned int textures[16]; #endif \ No newline at end of file