-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edited readme.md and uploaded Flow Chart #24
base: master
Are you sure you want to change the base?
Conversation
|
||
function randomColor () { | ||
var col = colorArr[randomNum()] | ||
return col |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may do this : return colorArr[randomNum()]
scoreObj.score += 10 | ||
scoreObj.scoreBoard.text(`Score : ${scoreObj.score}`) | ||
// TODO: No Click? click = false | ||
} else if (recArr[count - 1] != recArr[count - n]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!==
audioCorrect() | ||
scoreObj.score += 10 | ||
scoreObj.scoreBoard.text(`Score : ${scoreObj.score}`) | ||
} else if (recCol[count - 1] != recCol[count - n]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!==
// Random Number Generator | ||
function randomNum () { | ||
var index = Math.floor(Math.random() * 8) | ||
return index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may just return the value
} | ||
|
||
function audioCorrect () { | ||
return document.getElementById('audioCorrect').play() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we do this with jQuery?
var recCol = [] | ||
var count = 0 | ||
var index = 0 | ||
var on = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is a confusing name with .on()
. You can try gameOn
, gameStart
.
<div class="container"> | ||
<h1>Dual N Back Game Instructions</h1> | ||
|
||
<h3>Each turn a random location and color will flash on the gameboard. The goal is to memorize the location and color 'n' turns back. Currently n = 1. If the location or color of current turn is the same as that of the previous turn, we should trigger the location or color button</h3><br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why everything is h3
tags here?
<body> | ||
<audio id="audioCorrect" type="audio/mpeg" src="./audio/correctAnswer.mp3"></audio> | ||
<audio id="audioWrong" type="audio/mpeg" src="./audio/wrongAnswer.mp3"></audio> | ||
<div class="container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation issues here
var index = 0 | ||
var on = 0 | ||
var refreshIntervalId | ||
var n = 2 // Difficulty Setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why dont name this variable difficultyLevel
instead?
gameOverDiv.css('display', 'none') | ||
}) | ||
$colorBtn.on('click', compareColor) | ||
$(document).on('keydown', function (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you give some spaces in between these codes? group them logically so it's easier to be read
Project Workflow: 3 / 5 GlowScaling down on the idea. GrowNeed more detailed commit message, not like 'second try'. Things to look forI know it is hard to be familiar with many methods. Just keep practicing! |
No description provided.