started working on level 5

This commit is contained in:
Alexandre 2025-03-20 21:12:08 +01:00
parent f09196df7f
commit 97db1731e6
13 changed files with 206 additions and 26 deletions

View File

@ -16,7 +16,7 @@
# --| Mods (in case you find it easy) |-- # --| Mods (in case you find it easy) |--
*Hidden* (HD) : makes the terrain blink to be totally invisible sometimes *Hidden* (HD) : makes the terrain blink to be totally invisible sometimes
*HardRock* (HR) : multiplies damage taken, enables fall damage and kills you upon falling in the void *HardRock* (HR) : multiplies damage taken, enables fall damage and kills you upon falling into the void
*DoubleTime* (DT) : makes everything faster *DoubleTime* (DT) : makes everything faster
*SuddenDeath* (SD) : sets your HP at 1 and disables healing *SuddenDeath* (SD) : sets your HP at 1 and disables healing
*Flashlight* (FL) : drastically lowers your view distance *Flashlight* (FL) : drastically lowers your view distance
@ -36,7 +36,9 @@
if **there is only one file (==> its name is room_0) AND weight is 0**, the room will only generate at the central chunk (any other will be NULL) if **there is only one file (==> its name is room_0) AND weight is 0**, the room will only generate at the central chunk (any other will be NULL)
use this if you want to create parkour levels, puzzles... use this if you want to create parkour levels, puzzles...
else, **make sure the total weight (the sum of all) is not equal to 0** *(you may end up with a floating point exception)* else, **make sure the total weight (the sum of all) is not equal to 0** *(you may end up with a floating point exception)*
. no matter what, room_0 will **always** generate at chunk (0, 0)
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

BIN
bin/back

Binary file not shown.

28
levels/level_05/room_0 Normal file
View File

@ -0,0 +1,28 @@
Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128]
[-16.0, 80.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, -10.0, 5.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, 9.0, 5.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-10.0, 0.0, -2.5, 1.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 9.0, 0.0, -2.5, 1.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
Entities :
[-1.0, 0.0, -1.0, 2.0, 2.0, 2.0, 0.0, 0.0, 192, 192, 32, 1, 0, 8, 250, 1, 255, 128, 128]
[-0.5, 0.5, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 32, 1, 0, 7, levels/level_05/, 5, impressive, 128, 255, 128]
Weight :
0
$

35
levels/level_05/room_1 Normal file
View File

@ -0,0 +1,35 @@
Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128]
[-16.0, 80.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ -7.0, 0.0, -10.0, 14.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ -7.0, 0.0, 9.0, 14.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-10.0, 0.0, -2.5, 3.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 7.0, 0.0, -2.5, 3.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
Entities :
[-14.0, 1.0, -14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-14.0, 1.0, 13.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ 13.0, 1.0, -14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ 13.0, 1.0, 13.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-15.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[ 14.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[-15.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[ 14.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
Weight :
50
$

35
levels/level_05/room_2 Normal file
View File

@ -0,0 +1,35 @@
Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128]
[-16.0, 80.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, -10.0, 5.0, 8.0, 3.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, 7.0, 5.0, 8.0, 3.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-10.0, 0.0, -7.0, 1.0, 8.0, 14.0, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 9.0, 0.0, -7.0, 1.0, 8.0, 14.0, 0.0, 0.0, 192, 192, 192]
Entities :
[-14.0, 1.0, -14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-14.0, 1.0, 13.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ 13.0, 1.0, -14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ 13.0, 1.0, 13.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-15.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[ 14.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[-15.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
[ 14.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 10.2, 0.4, 2.5]
Weight :
50
$

37
levels/level_05/room_3 Normal file
View File

@ -0,0 +1,37 @@
Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128]
[-16.0, 80.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ -5.2, 0.0, -10.0, 10.4, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ -5.2, 0.0, 9.0, 10.4, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-10.0, 0.0, -5.2, 1.0, 8.0, 10.4, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 9.0, 0.0, -5.2, 1.0, 8.0, 10.4, 0.0, 0.0, 192, 192, 192]
[ -2.0, 0.0, -2.0, 4.0, 2.0, 4.0, 0.0, 0.0, 192, 192, 192]
[ -2.0, 6.0, -2.0, 4.0, 2.0, 4.0, 0.0, 0.0, 192, 192, 192]
Entities :
[ -0.5, 2.5, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 4, 0, 0]
[ -0.5, 4.0, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 4, 0, 0]
[ -0.5, 5.5, -0.5, 1.0, 0.5, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 7.0, 0.2, 2.5]
[-15.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 7.0, 0.2, 2.5]
[ 14.0, 7.0,-15.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 7.0, 0.2, 2.5]
[-15.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 7.0, 0.2, 2.5]
[ 14.0, 7.0, 14.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 7.0, 0.2, 2.5]
Weight :
50
$

37
levels/level_05/room_4 Normal file
View File

@ -0,0 +1,37 @@
Blocks :
[-16.0, -1.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 128, 128, 128]
[-16.0, 80.0, -16.0, 32.0, 1.0, 32.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, -16.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, -10.0, 5.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ -2.5, 0.0, 9.0, 5.0, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-16.0, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[ 1.5, 0.0, 15.0, 14.5, 8.0, 1.0, 0.0, 0.0, 192, 192, 192]
[-10.0, 0.0, -2.5, 1.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, -16.0, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 15.0, 0.0, 1.5, 1.0, 8.0, 14.5, 0.0, 0.0, 192, 192, 192]
[ 9.0, 0.0, -2.5, 1.0, 8.0, 5.0, 0.0, 0.0, 192, 192, 192]
[ -2.0, 0.0, -2.0, 4.0, 8.0, 4.0, 0.0, 0.0, 192, 192, 192]
Entities :
[-0.5, 1.0, -4.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-0.5, 1.0, 3.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[-4.5, 1.0, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ 3.5, 1.0, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 128, 2, 0, 0]
[ -0.5, 7.0, -9.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 9.0, 0.3, 2.5]
[ -0.5, 7.0, 8.0, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 9.0, 0.3, 2.5]
[ -9.0, 7.0, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 9.0, 0.3, 2.5]
[ 8.0, 7.0, -0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 255, 255, 255, 1, 0, 3, 0.0, 9.0, 0.3, 2.5]
Weight :
50
$

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -97,9 +97,12 @@ void speen(double x, double y, double z, double w, double h, double d, double hz
// metad2 = shot proj speed // metad2 = shot proj speed
// metad3 = shot proj freq // metad3 = shot proj freq
// metad4 = shot proj time to live // metad4 = shot proj time to live
// metad5 = time left before shooting
void speen2(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 speen2(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) {
ret->hz_angle += ((double)dtime)*ent->metad3; ret->hz_angle += ((double)dtime)*ent->metad3;
if((int)(5.0*ret->hz_angle) != (int)(5.0*(ret->hz_angle - ((double)dtime)*22.5))) { ent->metad5 -= (double)dtime;
if(ent->metad5 <= 0.0) {
ent->metad5 = ent->metad3;
double dx = (x+w/2 - (camx-choffx)); double dx = (x+w/2 - (camx-choffx));
double dy = (y+h/2 - (camy)); double dy = (y+h/2 - (camy));
double dz = (z+d/2 - (camz-choffz)); double dz = (z+d/2 - (camz-choffz));
@ -109,24 +112,26 @@ void speen2(double x, double y, double z, double w, double h, double d, double h
dz = ent->metad2*dz/total; dz = ent->metad2*dz/total;
appendProj(x+w/2+choffx, y+h/2, z+d/2+choffz, 0.1, 0.1, 0.1, -dx, -dy, -dz, 0.0, 0.0, 0.0, 255, 0, 0, 10, ent->metad4); appendProj(x+w/2+choffx, y+h/2, z+d/2+choffz, 0.1, 0.1, 0.1, -dx, -dy, -dz, 0.0, 0.0, 0.0, 255, 0, 0, 10, ent->metad4);
} }
double dx = (x+w/2 - (camx-choffx)); if(ent->metad1 != 0.0) {
double dy = (y+h/2 - (camy)); double dx = (x+w/2 - (camx-choffx));
double dz = (z+d/2 - (camz-choffz)); double dy = (y+h/2 - (camy));
double total = sqrt(dx*dx + dy*dy + dz*dz); double dz = (z+d/2 - (camz-choffz));
dx = ent->metad1*dx/total; double total = sqrt(dx*dx + dy*dy + dz*dz);
dy = ent->metad1*dy/total; dx = ent->metad1*dx/total;
dz = ent->metad1*dz/total; dy = ent->metad1*dy/total;
ret->x -= dtime*dx; dz = ent->metad1*dz/total;
if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) { ret->x -= dtime*dx;
ret->x += dtime*dx; if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) {
} ret->x += dtime*dx;
ret->y -= dtime*dy; }
if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) { ret->y -= dtime*dy;
ret->y += dtime*dy; if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) {
} ret->y += dtime*dy;
ret->z -= dtime*dz; }
if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) { ret->z -= dtime*dz;
ret->z += dtime*dz; if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) {
ret->z += dtime*dz;
}
} }
} }
@ -444,9 +449,9 @@ void go_to_player(double x, double y, double z, double w, double h, double d, do
double dy = (y+h/2 - (camy)); double dy = (y+h/2 - (camy));
double dz = (z+d/2 - (camz-choffz)); double dz = (z+d/2 - (camz-choffz));
double total = sqrt(dx*dx + dy*dy + dz*dz); double total = sqrt(dx*dx + dy*dy + dz*dz);
dx = 11.0*dx/total; dx = dx/total;
dy = 11.0*dy/total; dy = dy/total;
dz = 11.0*dz/total; dz = dz/total;
ret->x -= dtime*dx; ret->x -= dtime*dx;
if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) { if(is_colliding_with_map(ret) || is_colliding_with_tp(ret)) {
ret->x += dtime*dx; ret->x += dtime*dx;

View File

@ -516,6 +516,7 @@ void parse_one_room(int id, char* filename) {
pool[id].area->ents[k]->metad2 = bspd; pool[id].area->ents[k]->metad2 = bspd;
pool[id].area->ents[k]->metad3 = bfreq; pool[id].area->ents[k]->metad3 = bfreq;
pool[id].area->ents[k]->metad4 = bttl; pool[id].area->ents[k]->metad4 = bttl;
pool[id].area->ents[k]->metad5 = 0.0;
} else if(entry->id == 4) { } else if(entry->id == 4) {
// sine platform // sine platform
double ccw = read_float(ptr); double ccw = read_float(ptr);

View File

@ -315,7 +315,7 @@ void processInput(GLFWwindow *window, float dtime) {
case 4: reset_everything(window, 1, "levels/level_04/"); break; case 4: reset_everything(window, 1, "levels/level_04/"); break;
case 5: /*reset_everything(window, 4, "levels/level_05/");*/break; case 5: reset_everything(window, 5, "levels/level_05/"); break;
case 6: /*reset_everything(window, 4, "levels/level_06/");*/break; case 6: /*reset_everything(window, 4, "levels/level_06/");*/break;
@ -338,7 +338,7 @@ void processInput(GLFWwindow *window, float dtime) {
case 4: reset_everything(window, 1, "levels/level_04/"); break; case 4: reset_everything(window, 1, "levels/level_04/"); break;
case 5: /*reset_everything(window, 4, "levels/level_05/");*/break; case 5: reset_everything(window, 5, "levels/level_05/"); break;
case 6: /*reset_everything(window, 4, "levels/level_06/");*/break; case 6: /*reset_everything(window, 4, "levels/level_06/");*/break;