Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// GLOBAL FUNCTIONS BELOW

//good comments
function removeCountDown() {
$('#countdown').addClass('hidden');
} //closes removeCountDown function

//excellent grasp of jQuery!
function countDown(sec, e) {
if (sec === 0) {
$(e).html('Go!').css('left', '25%');
Expand All @@ -26,6 +27,7 @@ $(document).ready(function() {


//USE SPACEBAR TO BEGIN GAME
//good logic
$('*').keydown(function start(e){
if ( e.which === 32 && !gameIsOn) {
e.preventDefault();
Expand All @@ -43,6 +45,7 @@ $(document).ready(function() {
e.preventDefault();
if ( e.which === 39 && gameIsOn ) {
position1+=15;
//love the animation
$player2.animate({left: '+=15px'}, 0).toggleClass('transform');
} //closes if statement
if ( e.which === 65 && gameIsOn) {
Expand All @@ -54,6 +57,9 @@ $(document).ready(function() {
} // closes movePlayers function

//CHECK CHARACTER POSITION AND RESET VALUES
//very clear good logic. Could you reduce it even more by
//moving some of the common stuff outside the conditionals?
//not a big deal, just a thought
function evaluateWin() {
if (position2 === 1140 && position1 !== 1140) {
$('h3').removeClass('hidden');
Expand Down
1 change: 1 addition & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ button {
color: white;
}

/*very nice */
.transform {
-ms-transform: rotate(20deg); /* IE 9 */
-webkit-transform: rotate(20deg); /* Chrome, Safari, Opera */
Expand Down