diff --git a/bin/back b/bin/back index 3ab9365..625f3ee 100755 Binary files a/bin/back and b/bin/back differ diff --git a/obj/entities.o b/obj/entities.o index e567e3d..de4e199 100644 Binary files a/obj/entities.o and b/obj/entities.o differ diff --git a/obj/generation.o b/obj/generation.o index c4acedf..ce3a592 100644 Binary files a/obj/generation.o and b/obj/generation.o differ diff --git a/obj/main.o b/obj/main.o index a0a082a..b6ab86d 100644 Binary files a/obj/main.o and b/obj/main.o differ diff --git a/obj/menus.o b/obj/menus.o index 9fa34d6..2336bef 100644 Binary files a/obj/menus.o and b/obj/menus.o differ diff --git a/src/entities.c b/src/entities.c index 7efe2ad..ae620d5 100644 --- a/src/entities.c +++ b/src/entities.c @@ -97,17 +97,26 @@ void moving_xyz(double x, double y, double z, double w, double h, double d, doub // metai{2} = y_side (+/- 1) // metai{3} = z_side (+/- 1) 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) { + //printf("%lf %lf %lf", ent->metad7, ent->metad8, ent->metad9); + //printf("| %lf %lf %lf\n", ent->metad4, ent->metad5, ent->metad6); ret->x += (ent->metai1)*ent->metad4*dtime; if(absf(ent->metad1 - ret->x) > ent->metad7) { + //printf("-x-\n"); ent->metai1 *= (-1); + ret->x += (ent->metai1)*ent->metad4*dtime; } ret->y += (ent->metai2)*ent->metad5*dtime; + printf("%lf, %lf | %lf\n", ent->metad2, ret->y, ent->metad8); if(absf(ent->metad2 - ret->y) > ent->metad8) { + //printf("-y-\n"); ent->metai2 *= (-1); + ret->y += (ent->metai2)*ent->metad5*dtime; } ret->z += (ent->metai3)*ent->metad6*dtime; if(absf(ent->metad3 - ret->z) > ent->metad9) { + //printf("-z-\n"); ent->metai3 *= (-1); + ret->z += (ent->metai3)*ent->metad6*dtime; } } @@ -135,9 +144,9 @@ void translatePlayer(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) { } void translatePlayerLine(float dtime, int* hp, int* dmg, entity* ent, cube_0* ret) { - double dx = ent->metad4*(cos((double)(ent->metai1*(sim_time+(double)dtime)/ent->metai2 + ent->metai3*3.14159/180.0))-cos((double)(ent->metai1*sim_time/ent->metai2 + ent->metai3*3.14159/180.0))); - double dy = ent->metad5*(cos((double)(ent->metai1*(sim_time+(double)dtime)/ent->metai2 + ent->metai3*3.14159/180.0))-cos((double)(ent->metai1*sim_time/ent->metai2 + ent->metai3*3.14159/180.0))); - double dz = ent->metad6*(cos((double)(ent->metai1*(sim_time+(double)dtime)/ent->metai2 + ent->metai3*3.14159/180.0))-cos((double)(ent->metai1*sim_time/ent->metai2 + ent->metai3*3.14159/180.0))); + double dx = (ent->metai1)*ent->metad4*dtime; + double dy = (ent->metai2)*ent->metad5*dtime; + double dz = (ent->metai3)*ent->metad6*dtime; //fx += dx/(dtime*dtime); fy += dy/(dtime*dtime); //fz += dz/(dtime*dtime); diff --git a/src/generation.c b/src/generation.c index f01645b..4ff6d06 100644 --- a/src/generation.c +++ b/src/generation.c @@ -420,6 +420,10 @@ void parse_one_room(int id, char* filename) { double speed_x = read_float(ptr); double speed_y = read_float(ptr); double speed_z = read_float(ptr); + //printf("%lf, %lf, %lf, %lf, %lf, %lf\n", amp_x, amp_y, amp_z, speed_x, speed_y, speed_z); + pool[id].area->ents[k]->metad1 = cx; + pool[id].area->ents[k]->metad2 = cy; + pool[id].area->ents[k]->metad3 = cz; pool[id].area->ents[k]->metad4 = speed_x; pool[id].area->ents[k]->metad5 = speed_y; pool[id].area->ents[k]->metad6 = speed_z; diff --git a/src/main.c b/src/main.c index aeb3ec4..0ce9db7 100644 --- a/src/main.c +++ b/src/main.c @@ -225,7 +225,7 @@ int main_alt() { init_ent_generator(10); init_proj(); init_interf(); - parse_rooms(6); + parse_rooms(7); // ---------------------------------------------------------------------------------------------------------------------------------------------- // // ---------------------------------------------------------------------------------------------------------------------------------------------- // diff --git a/src/menus.c b/src/menus.c index 5f54c56..b6b4ae6 100644 --- a/src/menus.c +++ b/src/menus.c @@ -114,7 +114,7 @@ void gl_drawInteger(unsigned int fragShader, int n, float x, float y, float size left *= (-1); } if(side == 1) { - curx += ((ln_baseN(abs(n), 10)-1)*(size+4*width)); + curx += (((n==0)+ln_baseN(abs(n), 10)-1)*(size+4*width)); } while(left > 0) { gl_drawDigit(fragShader, left%10, curx, y, size, r, g, b, width); diff --git a/templates/room_5 b/templates/room_5 index f8baf58..f17cc4d 100644 --- a/templates/room_5 +++ b/templates/room_5 @@ -13,7 +13,7 @@ Entities: [0.0, 10.0, -5.0, 4.0, 1.0, 4.0, 0.0, 0.0, 192, 128, 192, 10, 0, 4, 0.0, 0.0, 5.0, 2, 1, 35] Weight : -100 +50 $ entities: diff --git a/templates/room_6 b/templates/room_6 new file mode 100644 index 0000000..10433f0 --- /dev/null +++ b/templates/room_6 @@ -0,0 +1,34 @@ +Blocks : +[-8.0, 0.0, -8.0, 16.0, 1.0, 16.0, 0.0, 0.0, 192, 192, 192] + +Teleporters : +[-10.0, 1.0, -1.0, 1.0, 2.0, 2.0, 0.0, 0.0, 255, 0, 0; -1, 0] +[-1.0, 1.0, -10.0, 2.0, 2.0, 1.0, 0.0, 0.0, 255, 255, 0; 0, -1] +[9.0, 1.0, -1.0, 1.0, 2.0, 2.0, 0.0, 0.0, 0, 255, 0; 1, 0] +[-1.0, 1.0, 9.0, 2.0, 2.0, 1.0, 0.0, 0.0, 0, 0, 255; 0, 1] + +Entities: +[-2.0, 4.1, -2.0, 4.0, 1.0, 4.0, 0.0, 0.0, 32, 128, 192, 10, 0, 5, 0.0, 4.0, 0.0, 0.0, 5.5, 0.0] +[-6.0, 8.1, -2.0, 4.0, 1.0, 4.0, 0.0, 0.0, 32, 128, 192, 10, 0, 5, 0.0, 4.0, 0.0, 0.0, 6.0, 0.0] +[6.0, 12.1, -2.0, 4.0, 1.0, 4.0, 0.0, 0.0, 32, 128, 192, 10, 0, 5, 0.0, 4.0, 0.0, 0.0, 6.5, 0.0] + +Weight : +50 + +$ +entities: +[x, y, z, w, h, d, rhz, rvt, red, green, blue, 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 + [..] \ No newline at end of file