Skip to content

Commit

Permalink
Merge pull request #162 from HyeokjinKang/gameplay-bug-fix-240708
Browse files Browse the repository at this point in the history
fix: ๊ฒŒ์ž„ํ”Œ๋ ˆ์ด ๋‚ด์˜ ์น˜๋ช…์ ์ธ ๋ฌธ์ œ
  • Loading branch information
HyeokjinKang authored Jul 7, 2024
2 parents d748e7b + e163709 commit c4c0ff4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion public/js/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ const retry = () => {
blackOverlayContainer.classList.add("show");
setTimeout(() => {
song.stop();
pattern = patternBackup;
pattern = JSON.parse(JSON.stringify(patternBackup));
bpm = pattern.information.bpm;
speed = pattern.information.speed;
bpmsync = {
Expand Down Expand Up @@ -1731,6 +1731,7 @@ document.onkeydown = (e) => {

document.onkeyup = (e) => {
e = e || window.event;
if (e.repeat) return;
let date = Date.now();
const beats = Number((bpmsync.beat + (song.seek() * 1000 - (offset + sync) - bpmsync.ms) / (60000 / bpm)).toPrecision(10));
if (e.key == "Escape") {
Expand Down
5 changes: 2 additions & 3 deletions public/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const ctx = canvas.getContext("2d");
const missCanvas = document.getElementById("missPointCanvas");
const missCtx = missCanvas.getContext("2d");
let pattern = {};
let patternBackup = {};
let patternLength = 0;
let settings, sync, song, tracks, pixelRatio, offset, bpm, speed;
let bpmsync = {
Expand Down Expand Up @@ -163,7 +162,6 @@ const initialize = (isFirstCalled) => {
missCanvas.height = window.innerHeight * 0.05 * pixelRatio;
if (isFirstCalled) {
pattern = JSON.parse(localStorage.pattern);
patternBackup = JSON.parse(localStorage.pattern);
patternLength = pattern.patterns.length;
document.getElementById("artist").textContent = pattern.information.producer;
document.getElementById("scoreArtist").textContent = pattern.information.producer;
Expand Down Expand Up @@ -1449,7 +1447,7 @@ const retry = () => {
blackOverlayContainer.classList.add("show");
setTimeout(() => {
song.stop();
pattern = patternBackup;
pattern = JSON.parse(localStorage.pattern);
bpm = pattern.information.bpm;
speed = pattern.information.speed;
bpmsync = {
Expand Down Expand Up @@ -1606,6 +1604,7 @@ const medalCheck = (n) => {

document.onkeydown = (e) => {
e = e || window.event;
if (e.repeat) return;
if (e.key == "Shift") {
shiftDown = true;
}
Expand Down
3 changes: 2 additions & 1 deletion public/js/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ const retry = () => {
blackOverlayContainer.classList.add("show");
setTimeout(() => {
song.stop();
pattern = patternBackup;
pattern = JSON.parse(JSON.stringify(patternBackup));
bpm = pattern.information.bpm;
speed = pattern.information.speed;
bpmsync = {
Expand Down Expand Up @@ -1623,6 +1623,7 @@ const medalCheck = (n) => {

document.onkeydown = (e) => {
e = e || window.event;
if (e.repeat) return;
if (e.key == "Shift") {
shiftDown = true;
}
Expand Down

0 comments on commit c4c0ff4

Please sign in to comment.