Skip to content

Commit

Permalink
mult numbers, stars, scroll bar
Browse files Browse the repository at this point in the history
  • Loading branch information
NarrikSynthfox committed Mar 7, 2024
1 parent d0c0e47 commit 7220e6a
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 74 deletions.
3 changes: 0 additions & 3 deletions Encore/Assets/highway/emh.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib emh.mtl
o HIGHWAY_EMH
v 2.000000 -0.000000 0.000000
v 2.000000 -0.000000 20.000000
Expand Down Expand Up @@ -48,12 +47,10 @@ vt 0.044482 1.000000
vt 0.955518 1.000000
vt 0.955518 0.000000
s 0
usemtl Highway_Background
f 1/1/1 12/2/1 5/3/1 2/4/1
f 12/2/1 11/5/1 6/6/1 5/3/1
f 11/5/1 10/7/1 7/8/1 6/6/1
f 10/7/1 9/9/1 8/10/1 7/8/1
usemtl Highway_Sides
f 20/11/2 19/12/2 13/13/2 14/14/2
f 18/15/3 17/16/3 16/17/3 15/18/3
f 1/19/2 2/20/2 17/16/2 18/15/2
Expand Down
3 changes: 0 additions & 3 deletions Encore/Assets/highway/expert.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib expert.mtl
o Expert_Highway
v 2.500000 -0.000000 0.000000
v 2.500000 -0.000000 20.000000
Expand Down Expand Up @@ -46,13 +45,11 @@ vt 0.022241 1.000000
vt 0.000000 1.000000
vt -0.000000 0.000000
s 0
usemtl Highway_Background
f 9/1/1 3/2/1 4/3/1 8/4/1
f 1/5/1 12/6/1 5/7/1 2/8/1
f 12/6/1 11/9/1 6/10/1 5/7/1
f 11/9/1 10/11/1 7/12/1 6/10/1
f 10/11/1 9/1/1 8/4/1 7/12/1
usemtl Highway_Sides
f 20/13/2 19/14/2 13/15/2 14/16/2
f 18/17/3 17/18/3 16/19/3 15/20/3
f 1/5/2 2/8/2 17/18/2 18/17/2
Expand Down
3 changes: 0 additions & 3 deletions Encore/Assets/highway/smasher.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib smasher.mtl
o Smashers
v 1.708885 0.010000 2.476520
v 1.708885 0.010000 2.723480
Expand Down Expand Up @@ -140,7 +139,6 @@ vt 0.010299 0.308657
vt 0.939869 0.915735
vt 0.864701 0.000001
s 1
usemtl Smasher_Outer
f 29/1/1 63/2/1 64/3/1
f 17/7/1 16/8/1 49/4/1
f 3/9/1 35/5/1 37/10/1
Expand Down Expand Up @@ -209,7 +207,6 @@ f 14/64/1 48/65/1 15/67/1
f 28/66/1 63/2/1 29/1/1
f 16/8/1 48/65/1 49/4/1
f 2/68/1 35/5/1 3/9/1
usemtl Smasher_Inner
f 49/4/1 35/5/1 50/6/1
f 50/6/1 35/5/1 51/35/1
f 51/35/1 36/41/1 53/19/1
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/notes/lift.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib lift.mtl
o Energy_Lifts.001
v 0.000000 0.170000 0.150000
v 0.000000 0.170000 -0.150000
Expand All @@ -27,7 +26,6 @@ vt 0.750000 0.490000
vt 0.957846 0.130000
vt 0.542154 0.130000
s 0
usemtl Lift_Note
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/1/2 4/2/2 6/3/2 5/4/2
f 4/4/3 2/5/3 6/6/3
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/notes/note.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib note.mtl
o Notes
v -0.000000 0.188537 -0.021310
v -0.000000 0.181467 -0.057049
Expand Down Expand Up @@ -594,7 +593,6 @@ vt 0.696785 0.772360
vt 0.692602 0.761928
vt 0.684209 0.618760
s 1
usemtl Note_Color
f 52/1/1 49/2/2 9/3/1 10/4/1
f 16/5/3 17/6/4 2/7/5 1/8/6
f 5/9/7 29/10/8 42/11/9 6/12/10
Expand Down
Binary file added Encore/Assets/ui/mult_number.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Encore/Assets/ui/mult_number_plane.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Blender 4.0.2
# www.blender.org
o Plane
v -0.300000 0.132365 0.270995
v 0.300000 0.132365 0.270995
v -0.300000 -0.074226 -0.292317
v 0.300000 -0.074226 -0.292317
vn -0.0000 0.9389 -0.3443
vt 0.250000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.750000
vt 0.250000 0.750000
s 0
f 1/1/1 2/2/1 4/3/1 3/4/1
2 changes: 0 additions & 2 deletions Encore/Assets/ui/multbar_3.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib multbar_3.mtl
o Multiplier_3bar
v 0.278893 -0.097661 -0.266293
v 0.000000 -0.136845 -0.373136
Expand Down Expand Up @@ -102,7 +101,6 @@ vt 0.100207 0.815253
vt 0.999770 0.815253
vt 0.999770 0.916759
s 1
usemtl Multiplier_Fill
f 43/1/1 39/2/1 29/3/1 33/4/1
f 13/5/1 14/6/1 24/7/1
f 24/7/1 23/8/1 15/9/1
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/ui/multbar_5.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib multbar_5.mtl
o Multiplier_5bar
v 0.278893 -0.097661 -0.266293
v 0.000000 -0.136845 -0.373136
Expand Down Expand Up @@ -102,7 +101,6 @@ vt 0.100437 0.665057
vt 1.000000 0.665057
vt 1.000000 0.766562
s 1
usemtl Multiplier_Fill
f 43/1/1 39/2/1 29/3/1 33/4/1
f 13/5/1 14/6/1 24/7/1
f 24/7/1 23/8/1 15/9/1
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/ui/multcircle_fill.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib multcircle_fill.mtl
o Multiplier.001
v -0.071852 -0.124376 -0.339137
v 0.000000 -0.126812 -0.345781
Expand Down Expand Up @@ -166,7 +165,6 @@ vt 0.533045 0.518079
vt 0.500000 0.644056
vt 0.500000 0.518079
s 1
usemtl Multiplier_Fill
f 1/1/1 3/2/1 35/3/2 33/4/3
f 3/2/1 4/5/1 36/6/4 35/3/2
f 4/5/1 5/7/1 37/8/5 36/6/4
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/ui/multcircle_frame.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib multcircle_frame.mtl
o Multiplier
v -0.278886 -0.097664 -0.266301
v -0.333919 -0.075660 -0.206302
Expand Down Expand Up @@ -1126,7 +1125,6 @@ vt 0.610003 0.286083
vt 0.602931 0.290331
vt 0.583198 0.260337
s 1
usemtl Multiplier_Background
f 138/1/1 140/2/1 29/3/1 27/4/1
f 140/2/1 141/5/1 30/6/1 29/3/1
f 141/5/1 1/7/1 31/8/1 30/6/1
Expand Down
18 changes: 18 additions & 0 deletions Encore/Assets/ui/multnumber.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#version 330

in vec2 fragTexCoord;
in vec4 fragColor;

uniform sampler2D texture0;
uniform float uvOffsetX;
uniform float uvOffsetY;
// Output fragment color
out vec4 finalColor;


void main()
{
// Texel color fetching from texture sampler
vec4 baseColor = texture(texture0, fragTexCoord+vec2(uvOffsetX,uvOffsetY));
finalColor = baseColor;
}
2 changes: 0 additions & 2 deletions Encore/Assets/ui/od_fill.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib od_fill.mtl
o Overdrive_Background.001
v -2.100395 0.082072 0.582621
v 2.100395 0.082072 0.582621
Expand Down Expand Up @@ -64,7 +63,6 @@ vt 0.000354 0.982751
vt 0.000000 0.985630
vt 0.001404 0.979982
s 1
usemtl Energy_Meter_Empty
f 29/1/1 30/2/1 18/3/1
f 30/2/1 1/4/1 17/5/1
f 1/4/1 2/6/1 16/7/1
Expand Down
2 changes: 0 additions & 2 deletions Encore/Assets/ui/od_frame.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Blender 4.0.2
# www.blender.org
mtllib od_frame.mtl
o Overdrive_Background
v -2.106329 0.082072 0.632384
v -2.128840 0.082072 0.626266
Expand Down Expand Up @@ -155,7 +154,6 @@ vt 0.642490 0.102537
vt 0.658156 0.028269
vt 0.748745 0.242391
s 1
usemtl Energy_Meter_Background
f 30/1/1 31/2/1 1/3/1
f 29/4/1 32/5/1 30/1/1
f 28/6/1 33/7/1 29/4/1
Expand Down
17 changes: 0 additions & 17 deletions Encore/Assets/ui/testplane.obj

This file was deleted.

42 changes: 21 additions & 21 deletions Encore/include/game/player.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//look this is the first header file ive ever created


#include <iostream>
int notesHit = 0;
int notesMissed = 0;
int perfectHit = 0;
Expand All @@ -25,41 +26,43 @@ float overdriveFill = 0.0f;
float overdriveActiveFill=0.0f;
double overdriveActiveTime = 0.0;

float uvOffsetX = 0;
float uvOffsetY = 0;

int stars() {
int baseScore = notes * 30;
int baseScore = 1080+720+360+((notes-30) * 144);

float starPercent = (float)score/(float)baseScore;

if (starPercent < xStarThreshold[0]) {return 0;}
else if (starPercent < xStarThreshold[1]) {return 1;}
else if (starPercent < xStarThreshold[1]) { return 1; }
else if (starPercent < xStarThreshold[2]) {return 2;}
else if (starPercent < xStarThreshold[3]) {return 3;}
else if (starPercent < xStarThreshold[4]) {return 4;}
else if (starPercent < xStarThreshold[5]) {return 5;}
else if (starPercent > xStarThreshold[5]) {goldStars = true;}
else if (starPercent >= xStarThreshold[5]) { goldStars = true; return 5; }
else return 5;

return 0;
}

int multiplier(int instrument) {
int od = overdrive ? 2 : 1;

if (instrument == 1 || instrument == 3){

if (combo < 10) { return 1 * od; }
else if (combo < 20) { return 2 * od; }
else if (combo < 30) { return 3 * od; }
else if (combo < 40) { return 4 * od; }
else if (combo < 50) { return 5 * od; }
else if (combo >= 50) { return 6 * od; }
if (combo < 10) { uvOffsetX = 0; uvOffsetY = 0 + (overdrive ? 0.5f:0); return 1 * od; }
else if (combo < 20) { uvOffsetX = 0.25f; uvOffsetY = 0 + (overdrive ? 0.5f : 0); return 2 * od; }
else if (combo < 30) { uvOffsetX = 0.5f; uvOffsetY = 0 + (overdrive ? 0.5f : 0); return 3 * od; }
else if (combo < 40) { uvOffsetX = 0.75f; uvOffsetY = 0 + (overdrive ? 0.5f : 0); return 4 * od; }
else if (combo < 50) { uvOffsetX = 0; uvOffsetY = 0.25f + (overdrive ? 0.5f : 0); return 5 * od; }
else if (combo >= 50) { uvOffsetX = 0.25f; uvOffsetY = 0.25f + (overdrive ? 0.5f : 0); return 6 * od; }
else { return 1 * od; };
}
else {
if (combo < 10) { return 1 * od; }
else if (combo < 20) { return 2 * od; }
else if (combo < 30) { return 3 * od; }
else if (combo >= 30) { return 4 * od; }
if (combo < 10) { uvOffsetX = 0; uvOffsetY = 0 + (overdrive ? 0.5 : 0); return 1 * od; }
else if (combo < 20) { uvOffsetX = 0.25f; uvOffsetY = 0 + (overdrive ? 0.5 : 0); return 2 * od; }
else if (combo < 30) { uvOffsetX = 0.5f; uvOffsetY = 0 + (overdrive ? 0.5 : 0); return 3 * od; }
else if (combo >= 30) { uvOffsetX = 0.75f; uvOffsetY = 0 + (overdrive ? 0.5 : 0); return 4 * od; }
else { return 1 * od; }
};
}
Expand All @@ -73,12 +76,9 @@ int maxMultForMeter(int instrument) {

float comboFillCalc(int instrument) {
if (instrument == 0 || instrument == 2) {
// conversation mbr
// shouldve been 0 and 2 :sob:
// also also it stops at the max combo, it doesnt do it one more time
// For instruments 2 and 4, limit the float value to 0.0 to 0.4
// For instruments 0 and 2, limit the float value to 0.0 to 0.4
if (combo >= 30) {
return 1.0f; // If combo is 40 or more, set float value to 1.0
return 1.0f; // If combo is 30 or more, set float value to 1.0
}
else {
return static_cast<float>(combo % 10) / 10.0f; // Float value from 0.0 to 0.9 every 10 notes
Expand All @@ -87,7 +87,7 @@ float comboFillCalc(int instrument) {
else {
// For instruments 1 and 3, limit the float value to 0.0 to 0.6
if (combo >= 50) {
return 1.0f; // If combo is 60 or more, set float value to 1.0
return 1.0f; // If combo is 50 or more, set float value to 1.0
}
else {
return static_cast<float>(combo % 10) / 10.0f; // Float value from 0.0 to 0.9 every 10 notes
Expand Down
Loading

0 comments on commit 7220e6a

Please sign in to comment.