Skip to content

Commit

Permalink
this is a commit message!
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyall-A committed Jun 26, 2024
1 parent 92b2b92 commit 5033db8
Show file tree
Hide file tree
Showing 20 changed files with 19,222 additions and 12 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
31 changes: 24 additions & 7 deletions Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,33 @@ class Game {

this.health = 100;
this.score = 0;
this.scoreNoMultiplier = 0;
this.multiplier = 1;
this.combo = 0;
this.maxCombo = 0;
this.badHits = 0;
this.misses = 0;
this.accuracy = 100.00;
this.givenPoints = {};
this.scoreNoMultiplier = 0;
}

async start() {
this.createUrl("hit", this.user.skin.sfx["hit"].data);
this.createUrl("combo-break", this.user.skin.sfx["combo-break"].data);
this.createUrl("music", this.map.audio.data);
this.createUrl("background", this.map.background.data);

setInterval(() => {
console.clear();
console.log("Health:", this.health);
console.log("Score:", this.score);
// console.log("Multiplier:", this.multiplier);
console.log("Combo:", this.combo);
console.log("Max Combo:", this.maxCombo);
console.log("Bad hits:", this.badHits);
console.log("Misses:", this.misses);
console.log("Accuracy:", this.accuracy);
}, 1000);

// Game loop
this.gameLoop(async (deltaTime, loop, fps) => {
Expand Down Expand Up @@ -76,7 +88,13 @@ class Game {
const noteToSpawn = this.notesToSpawn[0];
if (this.beatToMs(noteToSpawn[2]) + this.map.offset >= this.runningTime) break; // TODO: is this right?
this.spawnNote(noteToSpawn[0], noteToSpawn[1]);
this.notesToSpawn.shift();
this.notesToSpawn.shift();

// TESTING
setTimeout(() => {
this.onKeyPress(noteToSpawn[0] - 1);
setTimeout(() => this.onKeyRelease(noteToSpawn[0] - 1), 50);
}, this.getMsToKey());
}
}

Expand All @@ -85,8 +103,7 @@ class Game {
lane.notes.forEach(note => {
note.top += this.noteMoveAmount * deltaTime;
note.element.style.top = `${note.top}px`;
// if (!this.gameSettings.dontCheckIfNotesOffScreen && note.element.getBoundingClientRect().top > lane.elements.key.offsetTop) {
if (!this.gameSettings.dontCheckIfNotesOffScreen && note.element.getBoundingClientRect().top >= document.body.offsetHeight) {
if (!this.gameSettings.dontCheckIfNotesOffScreen && note.top - note.element.offsetHeight >= document.body.offsetHeight) {
if (!lane.elements.notes.contains(note.element)) return;
// Missed note
if (this.combo) this.playSfx("combo-break");
Expand Down Expand Up @@ -123,7 +140,8 @@ class Game {

getMsToKey(laneNum = 1) {
const laneIndex = laneNum - 1;
return this.lanes[laneIndex].elements.key.offsetTop / this.noteMoveAmount;
const lane = this.lanes[laneIndex];
return (lane.elements.key.offsetTop + lane.elements.key.offsetHeight) / this.noteMoveAmount;
}

async sleep(ms) {
Expand All @@ -134,7 +152,6 @@ class Game {
const laneIndex = laneNum - 1;
const lane = this.lanes[laneIndex];
let top = 0;
// let top = -this.getMsToKey(laneNum);
const noteElement = document.createElement("div");
noteElement.classList.add("note");
noteElement.style.top = `${top}px`;
Expand Down Expand Up @@ -163,7 +180,7 @@ class Game {
if (!url) return;
const audio = new Audio(url);
// TODO: add master volume here
if (options.volume) audio.volume = (this.user.settings.masterVolume / 100) * (options.volume != undefined ? options.volume / 100 : 1);
audio.volume = (this.user.settings.masterVolume / 100) * (options.volume != undefined ? options.volume / 100 : 1);
if (options.playbackRate) audio.playbackRate = options.playbackRate;
audio.onpause = e => audio.ended ? null : audio.play();
await audio.play();
Expand Down
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@
loadDefaultSkin(skin);

// const mapPath = "/maps/Quaver - Bimbo Limbo";
const mapPath = "/maps/Quaver - Endless Adventure";
// const mapPath = "/maps/Quaver - Endless Adventure";
// const mapPath = "/maps/Quaver - Wasted (Bootleg Version) (Cut Ver.)";
// const mapPath = "/maps/Quaver - this train going nowhere";
// const mapPath = "/maps/Quaver - paranoia (Extended Edit) (Sped Up Ver.)";
// const mapPath = "/maps/Quaver - Shiawase (VIP)";
// const mapPath = "/maps/Quaver - Lobotomy";
// const mapPath = "/maps/Quaver - Everlasting Eternity (uh oh)"; // funny 7k map
const levelIndex = 2;
// const levelIndex = 0;
const mapPath = "/maps/Quaver - Everlasting Eternity (uh oh)"; // funny 7k map
// const levelIndex = 2;
const levelIndex = 0;

const map = await getMapData(mapPath);
const level = await getLevelData(mapPath, map.levels[levelIndex]);

const user = {
settings: {
scrollSpeed: 20,
scrollSpeed: 30,
masterVolume: 25,
musicVolume: 100,
sfxVolume: 25,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[4,0,32.07750217539469],[4,0,33.577502277119954],[2,0,35.07750237884521],[2,0,36.57750248057047],[3,0,38.077502582295736],[1,0,40.07625271784464],[1,0,41.5762528195699],[3,0,43.076252921295165],[3,0,44.57625302302042],[2,0,46.07625312474568],[4,0,48.07875326054891],[4,0,49.57875336227416],[1,0,51.078753463999426],[1,0,52.57875356572469],[3,0,55.07625373509725],[2,0,56.077503802998855],[4,0,58.076253938547765],[1,0,59.077504006449374],[3,0,60.07875407435099],[4,0,61.076254141998284],[2,0,62.0775042098999],[3,0,63.07875427780151],[1,0,64.0762543454488],[4,0,64.0762543454488],[2,0,65.07750441335041],[3,0,65.57625444717407],[4,0,65.57625444717407],[1,0,66.57750451507567],[3,0,67.57875458297728],[2,0,68.07750461680094],[4,0,69.07875468470255],[3,0,69.5775047185262],[1,0,70.07625475234985],[1,0,71.07750482025146],[4,0,72.07875488815307],[2,0,72.57750492197673],[3,0,73.07625495580037],[1,0,73.57875498987833],[4,0,73.57875498987833],[3,0,74.57625505752563],[2,0,75.0787550916036],[1,0,76.07625515925089],[4,0,76.57875519332885],[2,0,77.57625526097615],[3,0,78.07875529505411],[1,0,79.0762553627014],[2,0,79.57875539677937],[3,0,80.07750543060303],[4,0,80.07750543060303],[1,0,81.07875549850463],[2,0,81.57750553232827],[4,0,81.57750553232827],[3,0,82.5787556002299],[1,0,83.07750563405354],[4,0,84.07875570195515],[2,0,84.5775057357788],[3,0,85.07625576960245],[1,0,86.07750583750406],[2,0,87.07875590540567],[4,0,88.07625597305297],[1,0,88.57875600713093],[3,0,89.07750604095459],[2,0,90.0787561088562],[4,0,90.57750614267984],[1,0,91.07625617650349],[3,0,92.0775062444051],[2,0,92.57625627822875],[4,0,93.07875631230671],[3,0,94.07625637995402],[1,0,95.07750644785563],[2,0,95.57625648167927],[4,0,96.07875651575723],[3,0,96.07875651575723],[4,0,97.5787566174825],[3,0,97.5787566174825],[2,0,99.07875671920776],[1,0,99.07875671920776],[1,0,100.57875682093301],[2,0,100.57875682093301],[4,0,102.07875692265827],[2,0,102.57750695648193],[3,0,103.07625699030558],[1,0,104.07750705820719],[4,0,104.07750705820719],[1,0,105.57750715993245],[4,0,105.57750715993245],[3,0,107.0775072616577],[2,0,107.0775072616577],[3,0,108.57750736338296],[2,0,108.57750736338296],[1,0,110.07750746510823],[3,0,110.57625749893188],[2,0,111.07875753300983],[4,0,111.57750756683349],[1,0,112.07625760065713],[3,0,112.07625760065713],[1,0,113.57625770238239],[3,0,113.57625770238239],[4,0,115.07625780410766],[2,0,115.07625780410766],[2,0,116.57625790583292],[4,0,116.57625790583292],[1,0,118.07625800755818],[3,0,118.57875804163614],[2,0,119.07750807545979],[4,0,120.0787581433614],[3,0,120.57750817718505],[1,0,121.07625821100869],[2,0,122.07750827891032],[3,0,122.57625831273396],[4,0,123.07875834681192],[1,0,124.07625841445922],[2,0,124.57875844853719],[4,0,125.07750848236083],[3,0,126.07875855026244],[2,0,126.57750858408609],[1,0,127.07625861790974],[4,0,128.07750868581135],[3,0,128.07750868581135],[2,0,129.07875875371298],[1,0,129.5775087875366],[4,0,129.5775087875366],[3,0,130.57875885543822],[2,0,131.57625892308553],[4,0,132.07875895716347],[1,0,133.07625902481078],[2,0,133.57875905888875],[3,0,134.0775090927124],[3,0,135.078759160614],[1,0,136.0762592282613],[4,0,136.57875926233928],[3,0,137.0775092961629],[2,0,137.57625932998656],[1,0,137.57625932998656],[3,0,138.57750939788818],[2,0,139.07625943171183],[4,0,140.07750949961343],[2,0,140.57625953343708],[3,0,141.5775096013387],[1,0,142.07625963516233],[2,0,143.07750970306395],[3,0,143.5762597368876],[4,0,144.07875977096558],[1,0,144.07875977096558],[2,0,145.07625983861286],[3,0,145.57875987269082],[4,0,145.57875987269082],[1,0,146.57625994033813],[4,0,147.07875997441607],[2,0,148.07626004206338],[1,0,148.57876007614135],[3,0,149.077510109965],[4,0,150.0787601778666],[2,0,151.0762602455139],[3,0,152.0775103134155],[1,0,152.57626034723916],[4,0,153.07876038131712],[2,0,154.07626044896443],[3,0,154.57876048304237],[1,0,155.07751051686603],[4,0,156.07876058476765],[2,0,156.5775106185913],[1,0,157.07626065241493],[3,0,158.07751072031655],[2,0,159.07876078821818],[4,0,159.57751082204183],[1,0,160.07626085586546],[3,0,160.07626085586546],[3,0,161.57626095759073],[1,0,161.57626095759073],[4,0,163.07626105931598],[2,0,163.07626105931598],[2,0,164.57626116104126],[4,0,164.57626116104126],[1,0,166.0762612627665],[2,0,166.57876129684448],[4,0,167.07751133066813],[3,0,167.57626136449176],[2,0,168.07876139856972],[1,0,168.07876139856972],[2,0,169.578761500295],[1,0,169.578761500295],[3,0,171.07876160202025],[4,0,171.07876160202025],[3,0,172.5787617037455],[4,0,172.5787617037455],[1,0,174.07876180547078],[4,0,174.57751183929443],[2,0,175.07626187311806],[3,0,175.57876190719603],[4,0,176.07751194101968],[1,0,176.07751194101968],[4,0,177.57751204274493],[1,0,177.57751204274493],[3,0,179.0775121444702],[2,0,179.0775121444702],[2,0,180.57751224619545],[3,0,180.57751224619545],[4,0,182.07751234792073],[3,0,182.57626238174436],[1,0,183.07876241582233],[2,0,184.07626248346963],[3,0,184.5787625175476],[4,0,185.07751255137123],[3,0,186.07876261927285],[2,0,186.5775126530965],[1,0,187.07626268692016],[3,0,188.07751275482175],[4,0,188.5762627886454],[2,0,189.07876282272338],[3,0,189.82876287358602],[2,0,190.57876292444863],[3,0,191.32876297531126],[1,0,192.0787630261739],[4,0,193.07626309382118],[1,0,194.0775131617228],[4,0,195.07876322962443],[1,0,196.0762632972717],[4,0,197.07751336517333],[1,0,198.07876343307493],[2,0,198.57751346689858],[3,0,199.07626350072223],[4,0,200.07751356862386],[2,0,201.07876363652545],[4,0,202.07626370417276],[2,0,203.07751377207435],[4,0,204.07876383997598],[2,0,205.0762639076233],[4,0,206.07751397552488],[3,0,206.57626400934853],[1,0,207.0787640434265],[3,0,208.07626411107378],[2,0,209.0775141789754],[3,0,210.07876424687703],[2,0,211.0762643145243],[3,0,212.07751438242593],[2,0,213.07876445032753],[3,0,214.07626451797483],[4,0,214.5787645520528],[1,0,215.07751458587646],[3,0,216.07876465377805],[2,0,217.07626472142536],[4,0,218.07751478932695],[1,0,219.07876485722858],[2,0,220.0762649248759],[3,0,220.57876495895383],[4,0,221.07751499277748],[3,0,222.0787650606791],[2,0,222.57751509450276],[1,0,223.07626512832638],[4,0,224.077515196228],[2,0,225.57751529795325],[3,0,226.0762653317769],[1,0,227.07751539967853],[4,0,228.07876546758015],[2,0,228.57751550140378],[1,0,230.07751560312906],[3,0,231.07876567103065],[1,0,232.07626573867796],[3,0,233.5762658404032],[2,0,234.07876587448118],[4,0,235.0762659421285],[1,0,236.07751601003008],[3,0,236.57626604385374],[4,0,238.076266145579],[2,0,239.0775162134806],[3,0,240.07876628138223],[3,0,241.0762663490295],[1,0,242.07751641693113],[1,0,243.07876648483276],[4,0,244.07626655248004],[4,0,245.07751662038166],[2,0,246.07876668828325],[2,0,247.07626675593056],[3,0,248.07751682383218],[1,0,248.07751682383218],[2,0,249.07876689173378],[4,0,249.07876689173378],[3,0,250.0762669593811],[1,0,250.0762669593811],[2,0,251.07751702728268],[4,0,251.07751702728268],[2,0,252.0787670951843],[1,0,252.0787670951843],[1,0,253.0762671628316],[2,0,253.0762671628316],[4,0,254.0775172307332],[3,0,254.0775172307332],[3,0,255.07876729863483],[4,0,255.07876729863483],[4,0,256.07626736628214],[1,0,256.07626736628214],[3,0,257.07751743418373],[2,0,257.57626746800736],[1,0,257.57626746800736],[4,0,258.577517535909],[2,0,259.5787676038106],[3,0,260.07751763763423],[1,0,261.0787677055359],[2,0,261.5775177393595],[4,0,262.0762677731832],[4,0,263.0775178410848],[1,0,264.0787679089864],[3,0,264.57751794281006],[2,0,265.0762679766337],[4,0,265.57876801071166],[1,0,265.57876801071166],[2,0,266.57626807835896],[3,0,267.07876811243693],[4,0,268.0762681800842],[1,0,268.57876821416215],[3,0,269.57626828180946],[2,0,270.07876831588743],[4,0,271.07626838353474],[3,0,271.5787684176127],[2,0,272.07751845143633],[1,0,272.07751845143633],[4,0,273.0787685193379],[3,0,273.5775185531616],[1,0,273.5775185531616],[2,0,274.5787686210632],[4,0,275.07751865488683],[1,0,276.0787687227885],[3,0,276.5775187566121],[2,0,277.0762687904358],[4,0,278.0775188583374],[3,0,279.078768926239],[1,0,280.0762689938863],[4,0,280.57876902796426],[2,0,281.0775190617879],[3,0,282.07876912968953],[1,0,282.57751916351316],[4,0,283.0762691973368],[2,0,284.07751926523844],[3,0,284.57626929906206],[1,0,285.07876933314003],[2,0,286.07626940078734],[4,0,287.07751946868893],[3,0,287.5762695025126],[1,0,288.0787695365905],[2,0,288.0787695365905],[1,0,289.5787696383158],[2,0,289.5787696383158],[3,0,291.0787697400411],[4,0,291.0787697400411],[4,0,292.57876984176636],[3,0,292.57876984176636],[1,0,294.0787699434916],[3,0,294.57751997731526],[2,0,295.0762700111389],[4,0,296.0775200790405],[1,0,296.0775200790405],[4,0,297.57752018076576],[1,0,297.57752018076576],[2,0,299.07752028249104],[3,0,299.07752028249104],[2,0,300.57752038421626],[3,0,300.57752038421626],[4,0,302.07752048594153],[2,0,302.5762705197652],[3,0,303.0787705538431],[1,0,303.5775205876668],[4,0,304.07627062149044],[2,0,304.07627062149044],[4,0,305.5762707232157],[2,0,305.5762707232157],[1,0,307.076270824941],[3,0,307.076270824941],[3,0,308.5762709266662],[1,0,308.5762709266662],[4,0,310.0762710283915],[2,0,310.57877106246946],[3,0,311.0775210962931],[1,0,312.07877116419473],[2,0,312.57752119801836],[4,0,313.07627123184204],[3,0,314.07752129974364],[2,0,314.57627133356726],[1,0,315.07877136764523],[4,0,316.07627143529254],[3,0,316.5787714693705],[1,0,317.07752150319413],[2,0,318.0787715710958],[3,0,318.5775216049194],[4,0,319.07627163874304],[1,0,320.0775217066447],[2,0,320.0775217066447],[3,0,321.0787717745463],[4,0,321.5775218083699],[1,0,321.5775218083699],[2,0,322.57877187627156],[3,0,323.5762719439188],[1,0,324.0787719779968],[4,0,325.0762720456441],[3,0,325.57877207972206],[2,0,326.0775221135457],[2,0,327.07877218144733],[4,0,328.07627224909464],[1,0,328.57877228317255],[2,0,329.07752231699624],[3,0,329.57627235081986],[4,0,329.57627235081986],[2,0,330.5775224187215],[3,0,331.07627245254514],[1,0,332.07752252044673],[3,0,332.5762725542704],[2,0,333.577522622172],[4,0,334.07627265599564],[3,0,335.0775227238973],[2,0,335.5762727577209],[1,0,336.0787727917989],[4,0,336.0787727917989],[3,0,337.0762728594462],[2,0,337.57877289352416],[1,0,337.57877289352416],[4,0,338.5762729611714],[1,0,339.0787729952494],[3,0,340.0762730628967],[4,0,340.57877309697466],[2,0,341.0775231307983],[1,0,342.07877319869993],[3,0,343.07627326634724],[2,0,344.07752333424884],[4,0,344.57627336807246],[1,0,345.07877340215043],[3,0,346.07627346979774],[2,0,346.5787735038757],[4,0,347.07752353769934],[1,0,348.078773605601],[3,0,348.5775236394246],[4,0,349.07627367324824],[2,0,350.0775237411499],[3,0,351.0787738090515],[1,0,351.5775238428751],[4,0,352.0762738766988],[2,0,352.0762738766988],[2,0,353.57627397842407],[4,0,353.57627397842407],[1,0,355.0762740801493],[3,0,355.0762740801493],[3,0,356.57627418187457],[1,0,356.57627418187457],[4,0,358.07627428359984],[3,0,358.5787743176778],[1,0,359.07752435150144],[2,0,359.57627438532506],[3,0,360.07877441940303],[4,0,360.07877441940303],[3,0,361.5787745211283],[4,0,361.5787745211283],[2,0,363.0787746228536],[1,0,363.0787746228536],[2,0,364.5787747245788],[1,0,364.5787747245788],[4,0,366.0787748263041],[1,0,366.5775248601277],[3,0,367.0762748939514],[2,0,367.57877492802936],[1,0,368.077524961853],[4,0,368.077524961853],[1,0,369.57752506357826],[4,0,369.57752506357826],[2,0,371.07752516530354],[3,0,371.07752516530354],[3,0,372.57752526702876],[2,0,372.57752526702876],[1,0,374.07752536875404],[2,0,374.57627540257766],[4,0,375.07877543665563],[3,0,376.07627550430294],[2,0,376.5787755383809],[1,0,377.07752557220454],[2,0,378.0787756401062],[3,0,378.5775256739298],[4,0,379.0762757077535],[2,0,380.0775257756551],[1,0,380.5762758094787],[3,0,381.0787758435567],[2,0,381.8287758944193],[3,0,382.57877594528196],[2,0,383.3287759961446],[4,0,384.07877604700724]]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"audio":{"file":"audio.ogg"},"cover":{"file":null},"background":{"file":"sad.jpg"},"name":"paranoia (Extended Edit) (Sped Up Ver.)","artist":"KENTENSHI","mappers":[{"name":"keksikosu"},{"name":"keksikosu"},{"name":"keksikosu"},{"name":"keksikosu"},{"name":"keksikosu"},{"name":"keksikosu"}],"offset":0,"bpm":225.00001525878906,"levels":[{"scrollSpeed":17,"name":"a normal end","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [a normal end].gml"},{"scrollSpeed":17,"name":"advanced depression","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [advanced depression].gml"},{"scrollSpeed":17,"name":"avel's it is hard to hear you","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [avel's it is hard to hear you].gml"},{"scrollSpeed":17,"name":"hera's another melancholy","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [hera's another melancholy].gml"},{"scrollSpeed":17,"name":"kizutsukenaide","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [kizutsukenaide].gml"},{"scrollSpeed":17,"name":"ppass' insane and cold pain","keys":4,"file":"KENTENSHI - paranoia (Extended Edit) (Sped Up Ver.) [ppass' insane and cold pain].gml"}]}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5033db8

Please sign in to comment.