lock box now display text when player is close by + fixed player jumping off coins + added single-file support

This commit is contained in:
Alexandre 2025-02-22 11:55:54 +01:00
parent 8e567fc419
commit f855642a60
30 changed files with 216 additions and 500 deletions

42
README.md Normal file
View File

@ -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
[..]

BIN
bin/back

Binary file not shown.

View File

@ -19,49 +19,3 @@ Weight :
0 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
[..]

View File

@ -13,33 +13,3 @@ Weight :
50 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
[..]

View File

@ -16,38 +16,3 @@ Weight :
50 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
[..]

View File

@ -8,33 +8,3 @@ Weight :
50 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
[..]

View File

@ -7,53 +7,12 @@ Blocks :
[13.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: Entities:
[-1.0, 15.0, -1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 255, 255, 255, 1, 10, 0] [-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 , 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] [-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.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 : Weight :
0 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
[..]

View File

@ -9,10 +9,10 @@ Blocks :
[-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192]
Entities : Entities :
[-2.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, -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, 1, 2, 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, 1, 2, 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, 1, 2, 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, 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] [-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] [-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]
@ -22,44 +22,3 @@ Weight :
50 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
[..]

View File

@ -9,10 +9,10 @@ Blocks :
[-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192]
Entities : Entities :
[-2.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, -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, 1, 2, 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, 1, 2, 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, 1, 2, 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, 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, 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] [-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]
@ -22,44 +22,3 @@ Weight :
50 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
[..]

View File

@ -9,10 +9,10 @@ Blocks :
[-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192]
Entities : Entities :
[-2.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, -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, 1, 2, 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, 1, 2, 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, 1, 2, 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, 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] [-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] [-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]
@ -22,44 +22,3 @@ Weight :
50 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
[..]

View File

@ -9,10 +9,10 @@ Blocks :
[-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192] [-1.0, 15.0, 15.0, 2.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192]
Entities : Entities :
[-2.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, -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, 1, 2, 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, 1, 2, 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, 1, 2, 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, 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, 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] [-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]
@ -22,44 +22,3 @@ Weight :
50 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
[..]

View File

@ -18,44 +18,3 @@ Weight :
75 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
[..]

View File

@ -22,44 +22,3 @@ Weight :
75 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
[..]

59
levels/level_02/room_0 Normal file
View File

@ -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
[..]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 713 B

View File

@ -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 // metad1 = time ON
// metad2 = time OFF // metad2 = time OFF
// metad3 = current time left // 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) // metach1 = text (stored here to free() easily)
void locker(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) { void locker(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) {
//printf("%d %d %d <<<<\n", ent->metai1, ent->metai2, ent->metai3); //printf("%d %d %d <<<<\n", ent->metai1, ent->metai2, ent->metai3);
interface_set(ent->metai1); //interface_set(ent->metai1);
if(coins >= ent->metai2) { if(coins >= ent->metai2) {
if(ent->metai3) { if(ent->metai3) {
coins -= ent->metai2; coins -= ent->metai2;

View File

@ -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(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 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 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 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); void detectHit(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret);

View File

@ -27,6 +27,8 @@ int total_weight;
int coins; int coins;
int fct_entry_size; int fct_entry_size;
bool is_one_room;
static char** to_free; static char** to_free;
static int to_length; static int to_length;
@ -106,9 +108,9 @@ void init_ent_generator(int n) {
hashtbl_entities[8].id = 8; hashtbl_entities[8].id = 8;
hashtbl_entities[8].tex = 7; hashtbl_entities[8].tex = 7;
hashtbl_entities[7].tex2 = 7; hashtbl_entities[8].tex2 = 7;
hashtbl_entities[8].name = "Lock"; 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].onHit = &locker;
hashtbl_entities[8].onDeath = NULL; hashtbl_entities[8].onDeath = NULL;
@ -586,7 +588,7 @@ void parse_one_room(int id, char* filename) {
msg[ki] = '\0'; msg[ki] = '\0';
// k=18 if singlt digit // 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]->metai2 = cost;
pool[id].area->ents[k]->metai3 = doPay; pool[id].area->ents[k]->metai3 = doPay;
pool[id].area->ents[k]->metach1 = msg; pool[id].area->ents[k]->metach1 = msg;
@ -678,6 +680,14 @@ void parse_rooms(int n_rooms, char* folder) {
free(name); free(name);
printf("Total sum : %d\n", total_weight); 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); generate_nearby_chunks(0);
current_room = hashtbl_find_opt(visited, player_chx, player_chy); 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)) { if(!hashtbl_mem(visited, player_chx + w, player_chy + h)) {
printf("generating (%d, %d)... ", player_chx + w, player_chy + h); fflush(stdout); printf("generating (%d, %d)... ", player_chx + w, player_chy + h); fflush(stdout);
//build_starting_chunk(player_chx + w, player_chy + h); //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 if(w == 0 && h == 0) { // 1st room will always be room_0
pick = -1; pick = -1;
} }
printf("R = %d ", pick); fflush(stdout); printf("R = %d ", pick); fflush(stdout);
int sum = 0; int sum = 0;
bool has_spawned = false;
for(int k = 0; k < pool_size; k++) { for(int k = 0; k < pool_size; k++) {
sum += pool[k].weight; sum += pool[k].weight;
if(pick < sum) { if(pick < sum) {
printf("chose %d\n", k); fflush(stdout); printf("chose %d\n", k); fflush(stdout);
has_spawned = true;
room* new = malloc(sizeof(room)); room* new = malloc(sizeof(room));
copy_room(pool[k].area, new, player_chx + w, player_chy + h); copy_room(pool[k].area, new, player_chx + w, player_chy + h);
//generate_terrain(new); //generate_terrain(new);
@ -736,6 +748,10 @@ void generate_nearby_chunks(int render_dist) {
k = pool_size+1; 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"); printf("Done\n");
} }
} }

View File

@ -57,6 +57,7 @@ void linkedList_add(linkedList lst, int chx, int chy, room* area) {
} }
void free_all_cubes(room* r) { void free_all_cubes(room* r) {
if(r != NULL) {
for(int k = 0; k < r->map_size; k++) { for(int k = 0; k < r->map_size; k++) {
free(r->map[k]); free(r->map[k]);
} }
@ -75,6 +76,7 @@ void free_all_cubes(room* r) {
free(r->tps); free(r->tps);
free(r->map); free(r->map);
} }
}
void linkedList_free(linkedList lst) { void linkedList_free(linkedList lst) {
// frees rooms as well (requires all created rooms to be there) // frees rooms as well (requires all created rooms to be there)

View File

@ -246,8 +246,9 @@ 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;
//reset_everything(window, 4, "levels/level_00/");
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 { } else {
rPress = false; rPress = false;
@ -443,8 +444,8 @@ int main_alt() {
generate_texture(5, "res/steel.jpeg", JPEG); generate_texture(5, "res/steel.jpeg", JPEG);
generate_texture(6, "res/gateway.jpeg", JPEG); generate_texture(6, "res/gateway.jpeg", JPEG);
generate_texture(7, "res/lock.png", PNG); generate_texture(7, "res/lock.png", PNG);
generate_texture(8, "res/beat_on.png", PNG); generate_texture(8, "res/beat_on.png", JPG);
generate_texture(9, "res/beat_off.png", PNG); generate_texture(9, "res/beat_off.png", JPG);
printf("-----------------------------------------------------------------------------------------------\n"); fflush(stdout); printf("-----------------------------------------------------------------------------------------------\n"); fflush(stdout);

View File

@ -265,7 +265,7 @@ bool is_colliding(float dtime) {
remove_entity(current_room->ents, &current_room->ent_memlen, &current_room->ent_len, k); remove_entity(current_room->ents, &current_room->ent_memlen, &current_room->ent_len, k);
} }
} }
if(updateForces) { if(updateForces && current_room->ents[k]->entity_type != 0) {
updateF(current_room->ents[k]->pos, (double)dtime); updateF(current_room->ents[k]->pos, (double)dtime);
} }
if(current_room->ents[k]->entity_type == 9) { if(current_room->ents[k]->entity_type == 9) {
@ -339,24 +339,32 @@ void movePlayerG(float dtime) {
void teleport_on_edge() { void teleport_on_edge() {
if(camx >= room_width) { if(camx >= room_width) {
if(!is_one_room) {
camx -= 2.0*room_width; camx -= 2.0*room_width;
player_chx += 1; player_chx += 1;
current_room = hashtbl_find_opt(visited, player_chx, player_chy); current_room = hashtbl_find_opt(visited, player_chx, player_chy);
resetProj(); resetProj();
}
} else if(camx <= -room_width) { } else if(camx <= -room_width) {
if(!is_one_room) {
camx += 2.0*room_width; camx += 2.0*room_width;
player_chx -= 1; player_chx -= 1;
current_room = hashtbl_find_opt(visited, player_chx, player_chy); current_room = hashtbl_find_opt(visited, player_chx, player_chy);
resetProj(); resetProj();
}
} else if(camz >= room_depth) { } else if(camz >= room_depth) {
if(!is_one_room) {
camz -= 2.0*room_depth; camz -= 2.0*room_depth;
player_chy += 1; player_chy += 1;
current_room = hashtbl_find_opt(visited, player_chx, player_chy); current_room = hashtbl_find_opt(visited, player_chx, player_chy);
resetProj(); resetProj();
}
} else if(camz <= -room_depth) { } else if(camz <= -room_depth) {
if(!is_one_room) {
camz += 2.0*room_depth; camz += 2.0*room_depth;
player_chy -= 1; player_chy -= 1;
current_room = hashtbl_find_opt(visited, player_chx, player_chy); current_room = hashtbl_find_opt(visited, player_chx, player_chy);
resetProj(); resetProj();
} }
} }
}

View File

@ -166,6 +166,7 @@ extern double fz;
extern int njumps; extern int njumps;
extern unsigned int fffff; extern unsigned int fffff;
extern unsigned int fShader;
extern int gamemode; extern int gamemode;
extern float incr; extern float incr;
@ -182,6 +183,8 @@ extern int loc_proj;
extern int loc_frag; extern int loc_frag;
extern int loc_tex; extern int loc_tex;
extern bool is_one_room;
extern unsigned int textures[16]; extern unsigned int textures[16];
#endif #endif