mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-25 12:57:03 +00:00
racing:: speedometer
This commit is contained in:
parent
3d08d359ee
commit
d864c8cc1e
6
hud.cpp
6
hud.cpp
@ -610,14 +610,16 @@ void drawStats() {
|
||||
for(int i=0; i<multi::players; i++) {
|
||||
if(race_finish_tick[i]) {
|
||||
multi::cpid = i;
|
||||
if(displayButtonS(vid.xres - 8, vid.fsize * (3+i), racetimeformat(race_finish_tick[i] - race_start_tick), (getcs().uicolor >> 8), 16, vid.fsize))
|
||||
if(displayButtonS(vid.xres - 8, vid.fsize * (3+2*i), racetimeformat(race_finish_tick[i] - race_start_tick), (getcs().uicolor >> 8), 16, vid.fsize))
|
||||
getcstat = 'o';
|
||||
}
|
||||
else {
|
||||
int comp = get_percentage(i);
|
||||
if(displayButtonS(vid.xres - 8, vid.fsize * (3+i), its(comp) + "%", (getcs().uicolor >> 8), 16, vid.fsize))
|
||||
if(displayButtonS(vid.xres - 8, vid.fsize * (3+2*i), its(comp) + "%", (getcs().uicolor >> 8), 16, vid.fsize))
|
||||
getcstat = 'o';
|
||||
}
|
||||
if(displayButtonS(vid.xres - 8, vid.fsize * (4+2*i), fts_fixed(shmup::pc[i]->vel * SCALE * 1000/600, 2), (getcs().uicolor >> 8), 16, vid.fsize))
|
||||
getcstat = 'o';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
1
hyper.h
1
hyper.h
@ -3761,6 +3761,7 @@ ld det(const transmatrix& T);
|
||||
void queuechr(const hyperpoint& h, int size, char chr, color_t col, int frame = 0);
|
||||
|
||||
string fts(ld x, int prec = 6);
|
||||
string fts_fixed(ld x, int prec = 6);
|
||||
|
||||
bool model_needs_depth();
|
||||
|
||||
|
@ -1853,6 +1853,7 @@ void movePlayer(monster *m, int delta) {
|
||||
ld r = hypot_d(WDIM, avg_inertia);
|
||||
nat = nat * rspintox(avg_inertia) * xpush(r * delta) * spintox(avg_inertia);
|
||||
if(WDIM == 3) nat = nat * cspin(0, 2, playerturn[cpid]) * cspin(1, 2, playerturny[cpid]);
|
||||
m->vel = r * (600/SCALE);
|
||||
}
|
||||
else if(WDIM == 3) {
|
||||
nat = nat1 * cpush(0, playerstrafe[cpid]) * cpush(2, playergo[cpid]) * cspin(0, 2, playerturn[cpid]) * cspin(1, 2, playerturny[cpid]);
|
||||
|
7
util.cpp
7
util.cpp
@ -34,6 +34,13 @@ string fts(ld x, int prec) {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
string fts_fixed(ld x, int prec) {
|
||||
std::stringstream ss;
|
||||
ss.precision(prec);
|
||||
ss << std::fixed << x;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
bool scan(fhstream& hs, int& i) { return fscanf(hs.f, "%d", &i) == 1; }
|
||||
bool scan(fhstream& hs, color_t& c) { return fscanf(hs.f, "%x", &c) == 1; }
|
||||
bool scan(fhstream& hs, ld& x) { return fscanf(hs.f, "%lf", &x) == 1; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user