Commit 7ef0ff60 authored by ogomez92's avatar ogomez92

pitch fix

parent d173fcfd
......@@ -3,7 +3,7 @@
<head>
<meta
charset="utf-8"/>
<title>Beatstar!</title>
<title>Beatstar</title>
<style type="text/css">
.speechArea {
position: absolute;
......
......@@ -510,7 +510,7 @@ for (let i = snd.playbackRate; i <= 1; i += 0.05) {
const bpm = this.bpms[this.level];
const time = this.scoreTimer.elapsed;
const score = Math.ceil(((bpm / 2) - Math.abs((bpm / 2) - time)) / (bpm / 2) * 100);
this.scoreCounter.pitch=utils.progressPitch(score,100);
this.scoreCounter.pitch=utils.progressPitch(score,1,100,1.0,2.0);
this.scoreCounter.stop();
this.scoreCounter.play();
this.scoreAverage.push(score);
......
'use strict';
if (typeof KeyEvent === 'undefined') {
var KeyEvent = {
DOM_VK_CANCEL: 3,
DOM_VK_HELP: 6,
......@@ -118,5 +117,4 @@ if (typeof KeyEvent === 'undefined') {
DOM_VK_QUOTE: 222,
DOM_VK_META: 224
};
}
export {KeyEvent};
......@@ -3,8 +3,8 @@ class GameUtils {
progressPan(current, max) {
return ((current*200/max)-100)/100;
}
progressPitch(current,max) {
return ((current*200/max))/100;
progressPitch(current,min,max,minPitch,maxPitch) {
return (current/(min+max))*(maxPitch-minPitch)+minPitch;
}
distance3D(x1, y1, z1, x2, y2, z2) {
return Math.sqrt((x2 - x1) * (x2 - x1) +
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,7 +28,6 @@
"howler": "^2.0.13",
"http-server": "^0.11.1",
"jquery": "^3.3.1",
"parcel-bundler": "^1.9.2",
"s": "^0.1.1",
"tone": "^13.2.0"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment