Skip to content

Commit

Permalink
breakneck speed
Browse files Browse the repository at this point in the history
  • Loading branch information
3drosalia committed Mar 1, 2024
1 parent dc6975c commit 0ce27d3
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions Encore/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(int argc, char* argv[])
float deltaTime = 0.0f;
int instrument = 0;
int diff = 0;


float timeCounter = 0.0f;

Expand Down Expand Up @@ -272,6 +272,15 @@ int main(int argc, char* argv[])
int curNoteIdx = 0;
int curODPhrase = 0;

////////////////////////////////////
//
// BREAKNECK SPEED
//

float bns = 2.0f;
bool bn = true;
const char* bnsButton = "Breakneck On";

ChangeDirectory(GetApplicationDirectory());

Model smasherReg = LoadModel((directory / "Assets/smasher.obj").string().c_str());
Expand Down Expand Up @@ -445,6 +454,19 @@ int main(int argc, char* argv[])
SetWindowSize(1920, 1080);
};
}
if (GuiButton({ (float)GetScreenWidth() - 100,120,100,60}, bnsButton)) {
if (!bn) {
bns = 2.0f;
bn = true;
bnsButton = "Breakneck On";
}
else
{
bns = 1.0f;
bn = false;
bnsButton = "Breakneck Off";
};
}
DrawTextureEx(song.albumArt, Vector2{ 5,(60 * curSong) + 5 }, 0.0f, 0.1f, RAYWHITE);

DrawText(song.title.c_str(), 60, (60 * curSong) + 5, 20, BLACK);
Expand Down Expand Up @@ -593,17 +615,17 @@ int main(int argc, char* argv[])
else {
if (curNote.time - 0.075 < laneTimes[curNote.lane] && curNote.time + 0.075 > laneTimes[curNote.lane]) {
curNote.hit = true;
if (curNote.len > 0.2) {
if ((curNote.len * bns) > 0.25) {
curNote.held = true;
}
}
if (laneTimes[curNote.lane] == 0.0 && curNote.len > 0.2) {
if (laneTimes[curNote.lane] == 0.0 && (curNote.len * bns) > 0.25) {
curNote.held = false;
}
}

double relTime = curNote.time - musicTime;
double relEnd = (curNote.time + curNote.len) - musicTime;
double relTime = (curNote.time - musicTime) * bns;
double relEnd = ((curNote.time + curNote.len) - musicTime) * bns;
bool od = false;
if (dmsExpert.odPhrases.size() > 0 && curODPhrase < dmsExpert.odPhrases.size()) {
if (curNote.time >= dmsExpert.odPhrases[curODPhrase].start && curNote.time <= dmsExpert.odPhrases[curODPhrase].end) {
Expand All @@ -626,9 +648,9 @@ int main(int argc, char* argv[])
}
else {
// sustains
if (curNote.len > 0.2) {
if ((curNote.len * bns)> 0.25) {
if (curNote.hit == true && curNote.held == true) {
if (curNote.heldTime < curNote.len) {
if (curNote.heldTime < (curNote.len * bns)) {
curNote.heldTime = 0.0 - relTime;
if (relTime < 0.0) relTime = 0.0;
}
Expand All @@ -647,7 +669,7 @@ int main(int argc, char* argv[])
DrawLine3D(Vector3{ diffDistance - (1.0f * curNote.lane),0.05f,2.5f + (12.5f * (float)relTime) }, Vector3{ diffDistance - (1.0f * curNote.lane),0.05f,2.5f + (12.5f * (float)relEnd) }, Color{ 172,82,217,255 });
}
// regular notes
if ((curNote.len>=0.2 && (curNote.held==true||curNote.hit==false)) || (curNote.len<0.2 && curNote.hit==false)) {
if (((curNote.len * bns) >=0.25 && (curNote.held==true||curNote.hit==false)) || ((curNote.len * bns)<0.25 && curNote.hit==false)) {
if (od == true)
DrawModel(noteModelOD, Vector3{ diffDistance - (1.0f * curNote.lane),0,2.5f + (12.5f * (float)relTime) }, 1.0f, WHITE);
else
Expand Down

0 comments on commit 0ce27d3

Please sign in to comment.