-
Notifications
You must be signed in to change notification settings - Fork 83
Testing Exercise Commit #35
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
base: master
Are you sure you want to change the base?
Conversation
canvas_exercise/shapes_game/index.js
Outdated
| clear(); //clear the canvas | ||
| drawRandomShape(); //add a random shape track scoring | ||
| countDown(); //start timer countdown | ||
| endGaame() //use as a callback for when timer countdown expires |
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.
Looks like this is a typo. But I think that typo was actually making your code work. You don't want to call endGame there because your game will never start.
canvas_exercise/shapes_game/index.js
Outdated
|
|
||
| function countDown() { | ||
| timerCountDown = 30; | ||
| var int = setInterval(function () { |
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 call this something like intervalId. Int is usually an integer type (which doesn't really exist in JS) so it can be a little confusing to name a variable int.
| expectedKeysMap = {white0: 38, red1: 40, red0: 37, white1: 39}, | ||
| timerSpan = document.getElementById("time-remaining"), | ||
| scoreSpan = document.getElementById("score-val"), | ||
| seconds = 3, |
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.
Overally good job. There are a few comments, but the code looks good.
|
Thanks for the feedback. I've implemented the suggested changes.
…On Mon, Aug 7, 2017 at 11:41 AM, Tim Garcia ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In canvas_exercise/shapes_game/index.js
<#35 (comment)>
:
> + var totalScore = 0;
+ var timerCountDown = 1;
+ var keyCodes = [37, 38, 39, 40];
+
+
+//-------------------------------------------------------------------
+//Opening screen
+drawStartText();
+
+//-------------------------------------------------------------------
+//Start Game
+ function startGame() {
+ clear(); //clear the canvas
+ drawRandomShape(); //add a random shape track scoring
+ countDown(); //start timer countdown
+ endGaame() //use as a callback for when timer countdown expires
Looks like this is a typo. But I think that typo was actually making your
code work. You don't want to call endGame there because your game will
never start.
------------------------------
In canvas_exercise/shapes_game/index.js
<#35 (comment)>
:
> + scoreSpan.innerHTML = totalScore;
+ clear()
+ drawRandomShape()
+ }
+ }
+ }
+
+ function randomCoordinate() {
+ return Math.floor(Math.random()*(600-100)+100);
+ }
+
+//-------------------------------------------------
+
+function countDown() {
+ timerCountDown = 30;
+ var int = setInterval(function () {
maybe call this something like intervalId. Int is usually an integer type
(which doesn't really exist in JS) so it can be a little confusing to name
a variable int.
------------------------------
In canvas_exercise/shapes_game/index.js
<#35 (comment)>
:
> @@ -26,11 +14,166 @@ window.addEventListener("load", function() {
seconds = 3,
Overally good job. There are a few comments, but the code looks good.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALo9DVk1zbG_oz4Ge6bhas5jOP7J4f91ks5sV1pEgaJpZM4OpJEh>
.
|
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.
Call apply and bind exercises look good. Looks like you're missing the hacker snooze ajax exercise and the prototypes exercise. Do you need to add more to the pull request?
|
|
||
| function arrayFrom() { | ||
| var finalArr = []; | ||
| for(var i = 0; i < arguments.length; i++) { |
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 can skip the new array and the loop by using slice:
return Array.prototype.slice.apply(arguments);
…te users and to Post and Get favorites.
No description provided.