From 21472f2feea376d517c2bf0e94316b4f7d389135 Mon Sep 17 00:00:00 2001 From: Randy Wilson Date: Tue, 28 May 2024 08:25:35 -0600 Subject: [PATCH] Add instructions. Fix stop. --- LICENSE | 2 + README.md | 47 ++++++++++++++++--- adam/adam.css | 26 ++++++++++- adam/adam.js | 81 ++++++++++++++++++++++----------- adam/index.html | 68 +++++++++++++++++++++++++-- adam/{ => sounds}/Adam.mp3 | Bin adam/{ => sounds}/JPop.mp3 | Bin adam/{ => sounds}/boip.mp3 | Bin adam/{ => sounds}/bup.mp3 | Bin adam/{ => sounds}/tiny-pop.mp3 | Bin 10 files changed, 185 insertions(+), 39 deletions(-) rename adam/{ => sounds}/Adam.mp3 (100%) rename adam/{ => sounds}/JPop.mp3 (100%) rename adam/{ => sounds}/boip.mp3 (100%) rename adam/{ => sounds}/bup.mp3 (100%) rename adam/{ => sounds}/tiny-pop.mp3 (100%) diff --git a/LICENSE b/LICENSE index 2530e3e..88467e6 100644 --- a/LICENSE +++ b/LICENSE @@ -12,6 +12,8 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The Adam song is free to use as part of this game, but all other rights are reserved. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/README.md b/README.md index 9de2662..be2492e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,50 @@ -The Adam Game! +# The Adam Game! + +## Instructions: + +* Click each "Adam" as it appears. +* Clicking faster earns bonus points. +* Turbo-auto-click is enabled after clearing the Adams from the first verse, + so you can just move over the Adams to clear them. +* After 64 points, all scores are multiplied by 1000! +* The final "Adummmmmm" is worth 100,000 points, but you have to click it. + +## Back story: Isabel was our foreign exchange student from Spain. -She never had an older brother to torment, so when -we asked her to go downstairs to tell Adam it was time for dinner, -she took great delight in calling out "Adam! Adam! -A-DUM! A-DUM! Adamadamadamadamadam!!!" +She never had an older brother to torment, so when we asked her +to go downstairs to tell our son Adam that it was time for dinner, +she took great delight in calling out "Adam! Adam! A-DUM! A-DUM! +Adamadamadamadamadam!!!" Adam was always very chill in his response to this. +One day at a dinner for the exchange students, Adam, Isabel and I +were standing in line to eat, and Isabel turned to Adam and said, +"Adamadamadamadamadam". + +Meanwhile, Adam calmly replied, "Yes? May I help you?". + So I decided to make a song about it. Adam said, "You can't have too many Adams in a song." I replied, "We'll see." +After writing the ground-breaking lyrics and recording a first draft +of the song, I had Isabel sing her part. Then I invited Adam in to +record him. "Say 'Yes?'", I told him, and he did so. Then I said, +"Say 'Oh, ok.'", and he complied. "Ok!" I told him, "That will do." + +He laughed as he looked at this big complicated Logic Pro project, +and said, "Yeah, don't worry about any of the rest of this!" + +When it was done, I played the song for him and the rest of the family +and ever since then, our family has often said Adam more times than +necessary when addressing him. + Instead of creating a music video to go with this song, -I thought it would be fun to make a video game out of it instead. +I thought it would be fun to make a video game out of it instead, +which I did for his 31st birthday. + +## GitHub + +This project is available on GitHub as open source. +Feel free to augment it and send a Pull Request. \ No newline at end of file diff --git a/adam/adam.css b/adam/adam.css index 017302b..6d7e119 100644 --- a/adam/adam.css +++ b/adam/adam.css @@ -24,11 +24,32 @@ body { font-size: large; } -.Randy,.Isabel,.Adam,.letter { +.Randy,.Isabel,.Adam,.letter,#button-holder,#tabs { position: relative; - display:inline; + display: inline; } +a:link,a:visited,#tabs { + color: #c6c6e5; +} +a:hover { + color: #e9e9ef +} +a:active { + color: #7777e5; +} +.selected-link { + background-color: #6363dc; +} + +#instructions,#backstory { + display: inline; + color: #e7e3ec; + font-size: large; +} +#backstory { + display: none; +} .Isabel { color: #fa5ca3; } @@ -68,3 +89,4 @@ body { .isa { background-color: #fa5ca3; } + diff --git a/adam/adam.js b/adam/adam.js index 9bf7385..3ff1924 100644 --- a/adam/adam.js +++ b/adam/adam.js @@ -28,15 +28,15 @@ const rebound = .8; const maxV = 300 / (1000 / animationInterval); function theAdamShow() { - song = new Audio("Adam.mp3"); + song = new Audio("sounds/Adam.mp3"); song.load(); - let tinyPop = new Audio("tiny-pop.mp3"); - let bup = new Audio("bup.mp3"); - let jpop = new Audio("JPop.mp3"); - let boip = new Audio("boip.mp3"); + let tinyPop = new Audio("sounds/tiny-pop.mp3"); + let bup = new Audio("sounds/bup.mp3"); + let jpop = new Audio("sounds/JPop.mp3"); + let boip = new Audio("sounds/boip.mp3"); sounds = [tinyPop, bup, jpop, boip]; - for (let i = 0; i < 10; i++) { - sounds.push(new Audio("tiny-pop.mp3")); + for (let i = 0; i < 40; i++) { + sounds.push(new Audio("sounds/tiny-pop.mp3")); } for (let sound of sounds) { sound.load(); @@ -44,14 +44,46 @@ function theAdamShow() { startGame(lines); } +function showInstructions() { + $("#adam").hide(); + $("#adams").hide(); + $("#backstory").hide(); + $("#instructions").show(); + $("#story-link").removeClass("selected-link"); + $("#instructions-link").addClass("selected-link"); +} + +function showBackstory() { + $("#adam").hide(); + $("#adams").hide(); + $("#instructions").hide(); + $("#backstory").show(); + $("#story-link").addClass("selected-link"); + $("#instructions-link").removeClass("selected-link"); +} + function startGame() { - lines = parseAdamTiming(); - $("#adam").html(""); - console.log("Playing song."); + $("#instructions").hide(); + $("#backstory").hide(); + $("#tabs").hide(); + $("#story-link").removeClass("selected-link"); + $("#instructions-link").removeClass("selected-link"); + + let $adam = $("#adam"); + $adam.html(""); + $adam.show(); + let $adams = $("#adams"); + $adams.html(""); + $adams.show(); + $("#button-holder").html("
"); + + lines = parseAdamTiming(); + let promise = song.play(); promise.then(); timer = setInterval(adamsDot, tempo140); + score = 0; speedBonus = 0; currentLine = 0; @@ -72,21 +104,7 @@ function updateScore() { $("#total-score").text(Math.round(score + speedBonus)); } -function stopSong() { - clearInterval(timer); - song.pause(); -} - -function isDumm(line) { - return line.pieces[currentPiece + 1].text.startsWith("dumm"); -} - function adamsDot() { - if (currentLine >= lines.length) { - console.log("Error: Too many lines. Stopping."); - clearInterval(timer); - return; - } // Adam's Dot -------- let line = lines[currentLine]; let piece = line.pieces[currentPiece]; @@ -121,13 +139,14 @@ function adamsDot() { if (piece.isAdam) { let displayTime = Date.now(); // time at which Adam was displayed. let adamId = getAdamId(currentLine, currentPiece); + let isDumm = line.pieces[currentPiece + 1].text.startsWith("dumm"); let $a = $("
" + "
A
" + "" + - (isDumm(line) ? line.pieces[currentPiece + 1].text : + (isDumm ? line.pieces[currentPiece + 1].text : "
d
" + "
a
" + "
m
") + @@ -163,6 +182,12 @@ function adamsDot() { } } +function stopSong() { + song.pause(); + song.currentTime = 0; + endGame(); +} + function endGame() { // Finished with the song and animation. console.log("Clearing timer"); @@ -170,7 +195,9 @@ function endGame() { clearInterval(floaterTimer); gameOver = true; $(".target").remove(); - $("#button-holder").html("
"); + $("#adams").html(""); + $("#button-holder").html(""); + $("#tabs").show(); } function getAdamId(lineIndex, pieceIndex) { diff --git a/adam/index.html b/adam/index.html index 2ce7519..2c4a015 100644 --- a/adam/index.html +++ b/adam/index.html @@ -13,12 +13,72 @@
The Adam Game! Score: 0 - Speed bonus:  - Total score:  -
-
+ Speed bonus: 0 + Total score: 0
+
+ +

+ +
+ Welcome to the Adam Game! +
    +
  • Click each "Adam" as it appears. +
      +
    • Clicking faster earns bonus points.
    • +
    • Isabel's Adams are worth double.
    • +
  • +
  • Turbo-auto-click is enabled after clearing the Adams from the first verse, so you can just move over the Adams to clear them.
  • +
  • After 64 points, all scores are multiplied by 1000!
  • +
  • The final "Adummmmmm" is worth 100,000 points, but you have to click it.
  • +
+
+ +
+ + When COVID first hit, our oldest son Adam happened to be staying with us + for a few months while he was waiting for his next apartment to be ready.

+ + Isabel was our wonderful foreign exchange student from Spain, and she was + staying with us at that same time.

+ + She never had an older brother to torment, so when we asked her + to go downstairs to tell our son Adam that it was time for dinner, + she took great delight in calling out "Adam! Adam! A-DUM! A-DUM! + Adamadamadamadamadam!!!"

+ + Adam was always very chill in his response to this.

+ + One day at a dinner for the exchange students, Adam, Isabel and I + were standing in line to get some food, and Isabel turned to Adam and said, + "Adamadamadamadamadam".

+ + Meanwhile, Adam calmly replied, "Yes? May I help you?".

+ + So I decided to make a song about it.

+ + Adam said, "You can't have too many Adams in a song." I replied, "We'll see."

+ + After writing the ground-breaking lyrics and recording a first draft + of the song, I had Isabel sing her part. Then I invited Adam in to + record him. "Say 'Yes?'", I told him, and he did so. Then I said, + "Say 'Oh, ok.'", and he complied. "Ok!" I told him, "That will do."

+ + He laughed as he looked at this big complicated Logic Pro project, + and said, "Yeah, don't worry about any of the rest of this!"

+ + When it was done, I played the song for him and the rest of the family + and ever since then, our family has often said Adam more times than + necessary when addressing him.

+ + Instead of creating a music video to go with this song, + I thought it would be fun to make a video game out of it instead, + which I did for Adam's 31st birthday. +

\ No newline at end of file diff --git a/adam/Adam.mp3 b/adam/sounds/Adam.mp3 similarity index 100% rename from adam/Adam.mp3 rename to adam/sounds/Adam.mp3 diff --git a/adam/JPop.mp3 b/adam/sounds/JPop.mp3 similarity index 100% rename from adam/JPop.mp3 rename to adam/sounds/JPop.mp3 diff --git a/adam/boip.mp3 b/adam/sounds/boip.mp3 similarity index 100% rename from adam/boip.mp3 rename to adam/sounds/boip.mp3 diff --git a/adam/bup.mp3 b/adam/sounds/bup.mp3 similarity index 100% rename from adam/bup.mp3 rename to adam/sounds/bup.mp3 diff --git a/adam/tiny-pop.mp3 b/adam/sounds/tiny-pop.mp3 similarity index 100% rename from adam/tiny-pop.mp3 rename to adam/sounds/tiny-pop.mp3