Skip to content

Commit

Permalink
3.7.1.2 (SONGv 3.7! 08/08/2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuayabR authored Aug 8, 2024
1 parent 218557b commit 7dc34a4
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 12 deletions.
93 changes: 89 additions & 4 deletions BeatzGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Title: Beatz
* Author: Victor//GuayabR
* Date: 16/05/2024
* Version: SONGv 3.7.1.1 test (release.version.subversion.bugfix)
* Version: SONGv 3.7.1.2 test (release.version.subversion.bugfix)
* GitHub Repository: https://github.com/GuayabR/Beatz
**/

Expand Down Expand Up @@ -426,6 +426,7 @@ function preloadSongs() {
"Resources/Songs/The Automotivo Infernal 1.0.mp3",
"Resources/Songs/WAKE UP!.mp3",
"Resources/Songs/Flashing Lights.mp3",
"Resources/Songs/RUN!.mp3",
"Resources/Songs/testingsong.mp3",
];

Expand Down Expand Up @@ -648,6 +649,7 @@ const songConfigs = {
"Resources/Songs/THE SCOTTS.mp3": { BPM: 130, noteSpeed: 0 },
"Resources/Songs/WAKE UP!.mp3": { BPM: 125, noteSpeed: 8 },
"Resources/Songs/Flashing Lights.mp3": { BPM: 90, noteSpeed: 10.5 },
"Resources/Songs/RUN!.mp3": { BPM: 135, noteSpeed: 10 },

// Song Versions

Expand Down Expand Up @@ -929,6 +931,10 @@ const songToAlbumMap = {
"THE SCOTTS": "THE SCOTTS",
"WAKE UP!": "WAKE UP!",
"Flashing Lights": "Graduation",
"RUN!": "RUN!",

// Song Versions

"Finesse (feat. Cardi B)": "24K Magic",
"WTF 2 - Slowed": "WTF 2 - Slowed",
"WTF 2 - Sped Up": "WTF 2 - Sped Up",
Expand Down Expand Up @@ -1014,6 +1020,10 @@ function preloadImages() {
"Resources/Covers/THE SCOTTS.jpg",
"Resources/Covers/ASTRONOMICAL.jpg",
"Resources/Covers/WAKE UP!.jpg",
"Resources/Covers/RUN!.jpg",

// Song Versions

"Resources/Covers/WTF 2 - Slowed.jpg",
"Resources/Covers/WTF 2 - Sped Up.jpg",
"Resources/Covers/Slide da Treme Melódica v2 - Slowed.jpg",
Expand Down Expand Up @@ -1238,7 +1248,7 @@ function filterSongs() {
let resultsCount = 0;

// Find the last song index
const lastSongIndex = songList.length - 1;
const lastSongIndex = songList.length;

songButtons.forEach(button => {
const songText = button.textContent.toLowerCase();
Expand Down Expand Up @@ -1644,6 +1654,10 @@ function getArtist(songSrc) {
"THE SCOTTS": "THE SCOTTS, Travis Scott, Kid Cudi",
"WAKE UP!": "MoonDeity",
"Flashing Lights": "Kanye West, Dwele",
"RUN!": "VALORANT, Odetari, Lay Banks",

// Song Versions

"Finesse (feat. Cardi B)": "Bruno Mars, Cardi B",
"WTF 2 - Slowed": "Ugovhb, EF",
"WTF 2 - Sped Up": "Ugovhb, EF",
Expand Down Expand Up @@ -2491,7 +2505,7 @@ function updateCanvas(timestamp, setIndex) {
PERFECT_HIT_RANGE_MAX = 578;
HIT_Y_RANGE_MIN = 485;
HIT_Y_RANGE_MAX = 615;
MISS_RANGE = 610;
MISS_RANGE = 630;
fpsBuffedHitRanges = true;
// console.warn(`EXTREMELY Low FPS! Hit ranges have been buffed greatly. FPS: ${FPS}`);
}
Expand All @@ -2501,7 +2515,7 @@ function updateCanvas(timestamp, setIndex) {
PERFECT_HIT_RANGE_MAX = 572;
HIT_Y_RANGE_MIN = 490;
HIT_Y_RANGE_MAX = 610;
MISS_RANGE = 620;
MISS_RANGE = 650;
fpsBuffedHitRanges = true;
// console.warn(`Low FPS! Hit ranges have been buffed. FPS: ${FPS}`);
}
Expand Down Expand Up @@ -2865,6 +2879,77 @@ function drawAutoHitText() {
ctx.fillText("Points are disabled for this playthrough.", 10, HEIGHT - 10);
}

// Get the modal and buttons
const customSongModal = document.getElementById("customSongModal");
const openCustomSongModal = document.getElementById("openCustomSongModal");
const closeCustomSong = document.getElementById("closeCustomSongModal");
const createButton = document.getElementById("createCustomSong");

// Open the modal
openCustomSongModal.onclick = function () {
customSongModal.style.display = "block";
deactivateKeybinds();
};

// Close the modal
closeCustomSong.onclick = function () {
customSongModal.style.display = "none";
activateKeybinds();
};

// Close the modal when clicking outside of it
window.onclick = function (event) {
if (event.target === customSongModal) {
customSongModal.style.display = "none";
}
};

// Handle file input and note generation
createButton.onclick = function () {
const fileInput = document.getElementById("songFile");
const titleInput = document.getElementById("customSongTitle").value;
const noteSpeed = parseInt(document.getElementById("noteSpeed").value);
const bpm = parseInt(document.getElementById("bpm").value);

if (fileInput.files.length === 0) {
alert("Please upload an MP3 file.");
return;
}

const file = fileInput.files[0];
if (file.type !== "audio/mp3") {
alert("Please upload a valid MP3 file.");
return;
}

const audio = new Audio(URL.createObjectURL(file));
audio.onloadedmetadata = function () {
const duration = audio.duration * 1000; // Convert duration to milliseconds

// Generate notes
const notes = generateRandomNotes(duration);

// Apply note speed and BPM
applyNoteSpeedAndBPM(noteSpeed, bpm);

// Start the game with the custom song
startCustomGame(file, titleInput, notes);
};
};

// Function to apply note speed and BPM
function applyNoteSpeedAndBPM(noteSpeed, bpm) {
// Implement your logic to apply note speed and BPM
console.log("Note Speed:", noteSpeed, "BPM:", bpm);
}

// Function to start the game with the custom song
function startCustomGame(file, title, notes) {
// Implement your logic to start the game with the given song and notes
console.log("Starting custom game with title:", title);
console.log("Notes:", notes);
}

// Global variable to track if notes are generated
let notesGenerated = false;

Expand Down
22 changes: 18 additions & 4 deletions BeatzGameTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Title: Beatz
* Author: Victor//GuayabR
* Date: 16/05/2024
* Version: SONGv 3.7.1.1 test (release.version.subversion.bugfix)
* Version: SONGv 3.7.1.2 test (release.version.subversion.bugfix)
* GitHub Repository: https://github.com/GuayabR/Beatz
**/

Expand Down Expand Up @@ -426,6 +426,7 @@ function preloadSongs() {
"Resources/Songs/The Automotivo Infernal 1.0.mp3",
"Resources/Songs/WAKE UP!.mp3",
"Resources/Songs/Flashing Lights.mp3",
"Resources/Songs/RUN!.mp3",
"Resources/Songs/testingsong.mp3",
];

Expand Down Expand Up @@ -648,6 +649,7 @@ const songConfigs = {
"Resources/Songs/THE SCOTTS.mp3": { BPM: 130, noteSpeed: 0 },
"Resources/Songs/WAKE UP!.mp3": { BPM: 125, noteSpeed: 8 },
"Resources/Songs/Flashing Lights.mp3": { BPM: 90, noteSpeed: 10.5 },
"Resources/Songs/RUN!.mp3": { BPM: 135, noteSpeed: 10 },

// Song Versions

Expand Down Expand Up @@ -929,6 +931,10 @@ const songToAlbumMap = {
"THE SCOTTS": "THE SCOTTS",
"WAKE UP!": "WAKE UP!",
"Flashing Lights": "Graduation",
"RUN!": "RUN!",

// Song Versions

"Finesse (feat. Cardi B)": "24K Magic",
"WTF 2 - Slowed": "WTF 2 - Slowed",
"WTF 2 - Sped Up": "WTF 2 - Sped Up",
Expand Down Expand Up @@ -1014,6 +1020,10 @@ function preloadImages() {
"Resources/Covers/THE SCOTTS.jpg",
"Resources/Covers/ASTRONOMICAL.jpg",
"Resources/Covers/WAKE UP!.jpg",
"Resources/Covers/RUN!.jpg",

// Song Versions

"Resources/Covers/WTF 2 - Slowed.jpg",
"Resources/Covers/WTF 2 - Sped Up.jpg",
"Resources/Covers/Slide da Treme Melódica v2 - Slowed.jpg",
Expand Down Expand Up @@ -1238,7 +1248,7 @@ function filterSongs() {
let resultsCount = 0;

// Find the last song index
const lastSongIndex = songList.length - 1;
const lastSongIndex = songList.length;

songButtons.forEach(button => {
const songText = button.textContent.toLowerCase();
Expand Down Expand Up @@ -1644,6 +1654,10 @@ function getArtist(songSrc) {
"THE SCOTTS": "THE SCOTTS, Travis Scott, Kid Cudi",
"WAKE UP!": "MoonDeity",
"Flashing Lights": "Kanye West, Dwele",
"RUN!": "VALORANT, Odetari, Lay Banks",

// Song Versions

"Finesse (feat. Cardi B)": "Bruno Mars, Cardi B",
"WTF 2 - Slowed": "Ugovhb, EF",
"WTF 2 - Sped Up": "Ugovhb, EF",
Expand Down Expand Up @@ -2491,7 +2505,7 @@ function updateCanvas(timestamp, setIndex) {
PERFECT_HIT_RANGE_MAX = 578;
HIT_Y_RANGE_MIN = 485;
HIT_Y_RANGE_MAX = 615;
MISS_RANGE = 610;
MISS_RANGE = 630;
fpsBuffedHitRanges = true;
// console.warn(`EXTREMELY Low FPS! Hit ranges have been buffed greatly. FPS: ${FPS}`);
}
Expand All @@ -2501,7 +2515,7 @@ function updateCanvas(timestamp, setIndex) {
PERFECT_HIT_RANGE_MAX = 572;
HIT_Y_RANGE_MIN = 490;
HIT_Y_RANGE_MAX = 610;
MISS_RANGE = 620;
MISS_RANGE = 650;
fpsBuffedHitRanges = true;
// console.warn(`Low FPS! Hit ranges have been buffed. FPS: ${FPS}`);
}
Expand Down
11 changes: 8 additions & 3 deletions BeatzSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ function detectDeviceType() {

function detectAndHandleDevice() {
// Function to detect the type of device and handle accordingly
const deviceType = detectDeviceType(); // Detect the type of device

if (deviceType === "Mobile" || deviceType === "iOS" || deviceType === "Android") {
if (userDevice === "Mobile" || userDevice === "iOS" || userDevice === "Android") {
// Check if the detected device is Mobile, iOS, or Android

document.querySelectorAll("button").forEach(button => (button.disabled = true)); // Disable all buttons on the page
Expand All @@ -60,7 +59,7 @@ function detectAndHandleDevice() {
document.getElementById("unsupportedMessage").style.display = "block"; // Show the unsupported device message

console.log("Mobile device detected. Game is not supported."); // Log a message indicating the game is not supported on mobile devices
} else if (deviceType === "Chromebook") {
} else if (userDevice === "Chromebook") {
// Check if the detected device is a Chromebook
canvas.style.scale = "0.9";
console.warn("Chromebook detected. Game might have reduced framerates."); // Log a warning about potential performance issues on Chromebooks
Expand Down Expand Up @@ -112,9 +111,15 @@ function toggleFullScreen() {
console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
});
console.log("Entered Fullscreen");
if (userDevice === "Chromebook") {
canvas.style.scale = "1";
}
} else {
document.exitFullscreen();
console.log("Exited Fullscreen");
if (userDevice === "Chromebook") {
canvas.style.scale = "0.9";
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,15 @@ Reworked album cover logic!
- Added a progress bar with timestamp and duration of the current song playing. Flashes depending on the song's BPM.
- Recent songs now saves when pressing next, previous or randomize song.
- If user is playing Beatz on a Chromebook device, the scale factor for the canvas is reduced to 0.8 so it fits on the user's screen.
- Users with FPS lower than 60 will have their miss range up to Y = 620, while FPS lower than 30 will have their miss range up to Y = 610.
- Added 2 missing songs from older updates: That's What I Like (Bruno Mars), Brand New Dance (Eminem)
## Fixes
- Fixed recent song randomizing the index instead of playing your recent song.
- Fixed notes being inconsistently checked for misses in lower framerates.
- Fixed setting presets not correctly applying new "Log Keys", "Default Hit Sound", and "Save Recent Songs" settings.
- Fixed setting presets not correctly applying new "Log Keys", "Default Hit Sound", and "Save Recent Songs" settings.
//

3.7.1.2 (SONGv 3.7! 08/08/2024)
- Added RUN! By VALORANT, Odetari, Lay Banks
- Fixed chromebooks users having black bars around the screen while playing Beatz! on fullscreen.
- Increased low FPS miss ranges. (60 FPS: 620 - 650 // 30 FPS: 610 - 640)

0 comments on commit 7dc34a4

Please sign in to comment.