mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 06:27:17 +00:00
ads:: using the new 'twisted' names
This commit is contained in:
parent
296719c8ca
commit
8c98d2f30e
@ -94,7 +94,7 @@ void restart() {
|
||||
|
||||
void run_ads_game() {
|
||||
|
||||
if(!sl2) set_geometry(gRotSpace);
|
||||
if(!sl2) set_geometry(gTwistedProduct);
|
||||
if(hybrid::csteps) {
|
||||
stop_game();
|
||||
hybrid::csteps = 0;
|
||||
|
@ -177,7 +177,7 @@ bool ads_turn(int idelta) {
|
||||
|
||||
if(!paused) {
|
||||
pdata.fuel -= dv;
|
||||
gen_particles(rpoisson(dv*fuel_particle_qty), vctr, ads_inverse(current * vctrV) * spin(ang*degree+M_PI) * rots::uxpush(0.06 * ads_scale), rsrc_color[rtFuel], fuel_particle_rapidity, fuel_particle_life, 0.02);
|
||||
gen_particles(rpoisson(dv*fuel_particle_qty), vctr, ads_inverse(current * vctrV) * spin(ang*degree+M_PI) * twist::uxpush(0.06 * ads_scale), rsrc_color[rtFuel], fuel_particle_rapidity, fuel_particle_life, 0.02);
|
||||
}
|
||||
|
||||
ld tc = 0;
|
||||
|
@ -29,7 +29,7 @@ void apply_duality(shiftmatrix& S) {
|
||||
}
|
||||
|
||||
void draw_game_cell(const cell_to_draw& cd) {
|
||||
bool hv = rotspace;
|
||||
bool hv = mtwisted;
|
||||
using cellptr = cell*;
|
||||
const cellptr& c = cd.c;
|
||||
const ads_matrix& V = cd.V;
|
||||
@ -118,7 +118,7 @@ void draw_game_cell(const cell_to_draw& cd) {
|
||||
}
|
||||
|
||||
hybrid::in_actual([&]{
|
||||
dynamicval<eGeometry> b(geometry, gRotSpace);
|
||||
dynamicval<eGeometry> b(geometry, gTwistedProduct);
|
||||
auto h = V * rock.at;
|
||||
rock.pt_main = cross0(current * h);
|
||||
});
|
||||
@ -130,7 +130,7 @@ void draw_game_cell(const cell_to_draw& cd) {
|
||||
auto& shape = *rock.shape;
|
||||
for(int i=0; i<isize(shape); i += 2) {
|
||||
hybrid::in_actual([&]{
|
||||
auto h = V * rock.at * rots::uxpush(shape[i] * ads_scale) * rots::uypush(shape[i+1] * ads_scale);
|
||||
auto h = V * rock.at * twist::uxpush(shape[i] * ads_scale) * twist::uypush(shape[i+1] * ads_scale);
|
||||
cross_result f = cross0(current * h);
|
||||
rock.pts.push_back(f);
|
||||
});
|
||||
@ -147,7 +147,7 @@ void draw_game_cell(const cell_to_draw& cd) {
|
||||
if((shift+z) < rock.life_start) continue;
|
||||
if((shift+z) > rock.life_end) continue;
|
||||
for(int i=0; i<isize(shape); i += 2) {
|
||||
auto h = rots::uxpush(shape[i] * ads_scale) * rots::uypush(shape[i+1] * ads_scale) * C0;
|
||||
auto h = twist::uxpush(shape[i] * ads_scale) * twist::uypush(shape[i+1] * ads_scale) * C0;
|
||||
curvepoint(h);
|
||||
}
|
||||
curvepoint_first();
|
||||
@ -179,7 +179,7 @@ void draw_game_cell(const cell_to_draw& cd) {
|
||||
if(hv) {
|
||||
auto& shape = shape_ship;
|
||||
for(int i=0; i<isize(shape); i += 2) {
|
||||
auto h = rots::uxpush(shape[i] * ads_scale) * rots::uypush(shape[i+1] * ads_scale) * C0;
|
||||
auto h = twist::uxpush(shape[i] * ads_scale) * twist::uypush(shape[i+1] * ads_scale) * C0;
|
||||
curvepoint(h);
|
||||
}
|
||||
curvepoint_first();
|
||||
@ -192,7 +192,7 @@ void draw_game_cell(const cell_to_draw& cd) {
|
||||
}
|
||||
|
||||
hybrid::in_actual([&]{
|
||||
dynamicval<eGeometry> b(geometry, gRotSpace);
|
||||
dynamicval<eGeometry> b(geometry, gTwistedProduct);
|
||||
auto h = V * rock.at;
|
||||
cr = cross0(current * h);
|
||||
});
|
||||
|
@ -367,7 +367,7 @@ bool ds_turn(int idelta) {
|
||||
|
||||
if(!paused) {
|
||||
pdata.fuel -= dv;
|
||||
ds_gen_particles(rpoisson(dv*fuel_particle_qty), inverse(current.T) * spin(ang*degree+M_PI) * rots::uxpush(0.06 * ds_scale), current.shift, rsrc_color[rtFuel], fuel_particle_rapidity, fuel_particle_life, 0.02);
|
||||
ds_gen_particles(rpoisson(dv*fuel_particle_qty), inverse(current.T) * spin(ang*degree+M_PI) * twist::uxpush(0.06 * ds_scale), current.shift, rsrc_color[rtFuel], fuel_particle_rapidity, fuel_particle_life, 0.02);
|
||||
}
|
||||
|
||||
ld tc = 0;
|
||||
|
@ -138,7 +138,7 @@ void add_rock(cell *c, cellinfo& ci, const ads_matrix& T) {
|
||||
r->resource = rt;
|
||||
r->expire = gen_expire();
|
||||
r->shape = &(rand() % 2 ? shape_rock2 : shape_rock);
|
||||
if(geometry != gRotSpace) { println(hlog, "wrong geometry detected in gen_rocks 2!"); exit(1); }
|
||||
if(geometry != gTwistedProduct) { println(hlog, "wrong geometry detected in gen_rocks 2!"); exit(1); }
|
||||
int q = 0;
|
||||
|
||||
auto cleanup = [&] (cell *c, ld t) {
|
||||
@ -159,7 +159,7 @@ void add_rock(cell *c, cellinfo& ci, const ads_matrix& T) {
|
||||
h[2] = 0;
|
||||
h[3] = 1; */
|
||||
if(0) for(int i=0; i<4; i++) {
|
||||
hyperpoint h = spin(90*degree*i) * rots::uxpush(0.15) * C0;
|
||||
hyperpoint h = spin(90*degree*i) * twist::uxpush(0.15) * C0;
|
||||
compute_life(hybrid::get_at(c, 0), unshift(r->at) * rgpushxto0(h), cleanup);
|
||||
}
|
||||
ci.rocks.emplace_back(std::move(r));
|
||||
@ -189,7 +189,7 @@ void gen_rocks(cell *c, cellinfo& ci, int radius) {
|
||||
}
|
||||
|
||||
hybrid::in_actual([&] {
|
||||
add_rock(c, ci, ads_matrix(spin(alpha) * rots::uxpush(r/2) * chg_shift(randd() * TAU) * spin(randd() * TAU) * lorentz(0, 3, randd() * rock_max_rapidity)));
|
||||
add_rock(c, ci, ads_matrix(spin(alpha) * twist::uxpush(r/2) * chg_shift(randd() * TAU) * spin(randd() * TAU) * lorentz(0, 3, randd() * rock_max_rapidity)));
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -248,7 +248,7 @@ void ads_crash_ship() {
|
||||
|
||||
void handle_crashes() {
|
||||
if(paused) return;
|
||||
if(rotspace) {
|
||||
if(mtwisted) {
|
||||
if(!currentmap) { println(hlog, "no currentmap!"); return; }
|
||||
PIU({ handle_crashes(); });
|
||||
return;
|
||||
|
@ -32,7 +32,7 @@ void switch_spacetime_to(bool b) {
|
||||
}
|
||||
|
||||
bool in_spacetime() {
|
||||
return main_rock ? hyperbolic : rotspace;
|
||||
return main_rock ? hyperbolic : mtwisted;
|
||||
}
|
||||
|
||||
void switch_spacetime() {
|
||||
@ -145,7 +145,7 @@ void replay_animation() {
|
||||
centerover->wall = waNone;
|
||||
}
|
||||
|
||||
if(!main_rock && rotspace) {
|
||||
if(!main_rock && mtwisted) {
|
||||
check_cgi();
|
||||
|
||||
ads_matrix CV = current * vctrV;
|
||||
|
Loading…
Reference in New Issue
Block a user