1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-16 13:48:04 +00:00

nilrider:: synchronized music

This commit is contained in:
Zeno Rogue
2022-08-14 19:24:13 +02:00
parent dbab2254c6
commit 82e2e853bf
2 changed files with 26 additions and 7 deletions

View File

@@ -472,6 +472,9 @@ ld level::safe_alt(hyperpoint h, ld mul, ld mulx) {
bool stepped_display;
int nilrider_tempo = 562;
int nilrider_shift = 2633;
void level::draw_level(const shiftmatrix& V) {
int id = 0;
init_statues();
@@ -483,7 +486,11 @@ void level::draw_level(const shiftmatrix& V) {
id++;
if(!gotit) {
for(int i=0; i<6; i++) {
auto &poly = queuepoly(V * rgpushxto0(t.where) * cpush(2, abs(0.2 * sin(current.timer * 5))), shMini[i], t.colors[i]);
ld tim = current.timer * 1000;
tim -= nilrider_shift;
tim /= nilrider_tempo;
tim = abs(0.2 * sin(tim * M_PI));
auto &poly = queuepoly(V * rgpushxto0(t.where) * cpush(2, tim), shMini[i], t.colors[i]);
poly.tinf = &floor_texture_vertices[cgi.shFloor.id];
ensure_vertex_number(*poly.tinf, poly.cnt);
}