From 9d0278fc2b0f94d4892eb1d8470da0ebde2b914f Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 09:04:18 -0600 Subject: [PATCH 01/27] Update index.html --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index d971cf9e0..04dc4d2a2 100644 --- a/index.html +++ b/index.html @@ -27,8 +27,7 @@

Congratulations!

-

You have successfully created a pipeline that retrieved this source application from an Amazon S3 bucket and deployed it - to three Amazon EC2 instances using AWS CodeDeploy.

+

You have successfully created a pipeline that retrieved this source application from GitHub and deployed it to one Amazon EC2 instance using AWS Elastic Beanstalk. You’re one step closer to practicing continuous deployment!

For next steps, read the AWS CodePipeline Documentation.

From 7e31de631aab307c59189bc95a73da0fb074a109 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 09:05:58 -0600 Subject: [PATCH 02/27] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 04dc4d2a2..397ff94e2 100644 --- a/index.html +++ b/index.html @@ -29,6 +29,7 @@

Congratulations!

You have successfully created a pipeline that retrieved this source application from GitHub and deployed it to one Amazon EC2 instance using AWS Elastic Beanstalk. You’re one step closer to practicing continuous deployment!

For next steps, read the AWS CodePipeline Documentation.

+

Does this potato the nice green success window?

From 0ed490558b989570041696ae0c1da7424f919a88 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 12:22:58 -0600 Subject: [PATCH 03/27] Update index.html Added snake game --- index.html | 188 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 154 insertions(+), 34 deletions(-) diff --git a/index.html b/index.html index 397ff94e2..973ed223b 100644 --- a/index.html +++ b/index.html @@ -1,36 +1,156 @@ - - - - Sample Deployment - - - -
-

Congratulations!

-

You have successfully created a pipeline that retrieved this source application from GitHub and deployed it to one Amazon EC2 instance using AWS Elastic Beanstalk. You’re one step closer to practicing continuous deployment!

-

For next steps, read the AWS CodePipeline Documentation.

-

Does this potato the nice green success window?

-
- - + + + + + + + HTML5 Snake + + + + + + + + + + + +

HTML5 SNAKE

+ + From 938a16b920c60510ae72f2607791e3e150f00a26 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 12:36:08 -0600 Subject: [PATCH 04/27] Update index.html attempting to make game not auto start --- index.html | 58 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/index.html b/index.html index 973ed223b..6cdee087f 100644 --- a/index.html +++ b/index.html @@ -35,6 +35,8 @@ * Copyright (c) 2011, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/ + var begin = 0; + function init() { var ctx; var turn = []; @@ -49,7 +51,7 @@ var interval = 0; var score = 0; var inc_score = 50; - var sum = 0, easy = 0; + var sum = 0, easy = 1; var i, dir; var canvas = document.createElement('canvas'); for (i = 0; i < 45; i++) { @@ -69,6 +71,7 @@ ctx.strokeRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2); } placeFood(); + function clock() { if (easy) { X = (X+45)%45; @@ -117,40 +120,47 @@ placeFood(); } else { window.clearInterval(interval); - window.location = "/projects/"; } } } - interval = window.setInterval(clock, 60); - document.onkeydown = function(e) { - var code = e.keyCode - 37; - /* - * 0: left - * 1: up - * 2: right - * 3: down - **/ - if (0 <= code && code < 4 && code !== turn[0]) { - turn.unshift(code); - } else if (-5 == code) { - if (interval) { - window.clearInterval(interval); - interval = null; - } else { - interval = window.setInterval(clock, 60); + if(begin){ + interval = window.setInterval(clock, 60); + document.onkeydown = function(e) { + var code = e.keyCode - 37; + /* + * 0: left + * 1: up + * 2: right + * 3: down + **/ + if (0 <= code && code < 4 && code !== turn[0]) { + turn.unshift(code); + } else if (-5 == code) { + if (interval) { + window.clearInterval(interval); + interval = null; + } else { + interval = window.setInterval(clock, 60); + } + } else { // O.o + dir = sum + code; + if (dir == 44||dir==94||dir==126||dir==171) { + sum+= code + } else if (dir === 218) easy = 1; } - } else { // O.o - dir = sum + code; - if (dir == 44||dir==94||dir==126||dir==171) { - sum+= code - } else if (dir === 218) easy = 1; } } } + + function begin(){ + begin = 1; + init(); + }

HTML5 SNAKE

+ From a6d95fb976d1208274e3f6e3298e3d490a952126 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 12:39:25 -0600 Subject: [PATCH 05/27] Update index.html take two on button activation --- index.html | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 6cdee087f..675e6a1b2 100644 --- a/index.html +++ b/index.html @@ -123,44 +123,43 @@ } } } - if(begin){ - interval = window.setInterval(clock, 60); - document.onkeydown = function(e) { - var code = e.keyCode - 37; - /* - * 0: left - * 1: up - * 2: right - * 3: down - **/ - if (0 <= code && code < 4 && code !== turn[0]) { - turn.unshift(code); - } else if (-5 == code) { - if (interval) { - window.clearInterval(interval); - interval = null; - } else { - interval = window.setInterval(clock, 60); - } - } else { // O.o - dir = sum + code; - if (dir == 44||dir==94||dir==126||dir==171) { - sum+= code - } else if (dir === 218) easy = 1; + while(!begin){} + interval = window.setInterval(clock, 60); + document.onkeydown = function(e) { + var code = e.keyCode - 37; + /* + * 0: left + * 1: up + * 2: right + * 3: down + **/ + if (0 <= code && code < 4 && code !== turn[0]) { + turn.unshift(code); + } else if (-5 == code) { + if (interval) { + window.clearInterval(interval); + interval = null; + } else { + interval = window.setInterval(clock, 60); } + } else { // O.o + dir = sum + code; + if (dir == 44||dir==94||dir==126||dir==171) { + sum+= code + } else if (dir === 218) easy = 1; } } } function begin(){ begin = 1; - init(); }

HTML5 SNAKE

+

From cba8312e09b045b6f4a5aac1b4075de4b7f6c92e Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 12:59:36 -0600 Subject: [PATCH 06/27] Update index.html take 3 --- index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 675e6a1b2..f380405b2 100644 --- a/index.html +++ b/index.html @@ -123,7 +123,7 @@ } } } - while(!begin){} + holdToStart(); interval = window.setInterval(clock, 60); document.onkeydown = function(e) { var code = e.keyCode - 37; @@ -151,6 +151,15 @@ } } + function holdToStart(){ + if(!begin){ + setTimeout(hold, 0); + } + else{ + callback(); + } + } + function begin(){ begin = 1; } From f4b2e685a7e6b54e1de2048c8e9085b056a89cca Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:01:34 -0600 Subject: [PATCH 07/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index f380405b2..e370d1ab7 100644 --- a/index.html +++ b/index.html @@ -153,7 +153,7 @@ function holdToStart(){ if(!begin){ - setTimeout(hold, 0); + setTimeout(hold, 10); } else{ callback(); From 93d4ac40331b3463dca8e4e789e7ca3876ee3217 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:04:45 -0600 Subject: [PATCH 08/27] Update index.html --- index.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/index.html b/index.html index e370d1ab7..d70a05eee 100644 --- a/index.html +++ b/index.html @@ -123,7 +123,6 @@ } } } - holdToStart(); interval = window.setInterval(clock, 60); document.onkeydown = function(e) { var code = e.keyCode - 37; @@ -151,14 +150,6 @@ } } - function holdToStart(){ - if(!begin){ - setTimeout(hold, 10); - } - else{ - callback(); - } - } function begin(){ begin = 1; From 7f9434764401564aab1c14897db17b5fca80950d Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:06:40 -0600 Subject: [PATCH 09/27] Update index.html --- index.html | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index d70a05eee..149a6f407 100644 --- a/index.html +++ b/index.html @@ -34,9 +34,7 @@ * * Copyright (c) 2011, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. - **/ - var begin = 0; - + **/ function init() { var ctx; var turn = []; @@ -51,7 +49,7 @@ var interval = 0; var score = 0; var inc_score = 50; - var sum = 0, easy = 1; + var sum = 0, easy = 0; var i, dir; var canvas = document.createElement('canvas'); for (i = 0; i < 45; i++) { @@ -150,16 +148,11 @@ } } - - function begin(){ - begin = 1; - }

HTML5 SNAKE

- From 7dfc028147f5b38dad3f6c46c66c7dd592fed58f Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:10:43 -0600 Subject: [PATCH 10/27] Update index.html --- index.html | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 149a6f407..236a61a44 100644 --- a/index.html +++ b/index.html @@ -35,23 +35,25 @@ * Copyright (c) 2011, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/ + var ctx; + var turn = []; + var xV = [-1, 0, 1, 0]; + var yV = [0, -1, 0, 1]; + var queue = []; + var elements = 1; + var map = []; + var X = 5 + (Math.random() * (45 - 10))|0; + var Y = 5 + (Math.random() * (30 - 10))|0; + var direction = Math.random() * 3 | 0; + var interval = 0; + var score = 0; + var inc_score = 50; + var sum = 0, easy = 0; + var i, dir; + var canvas = document.createElement('canvas'); + function init() { - var ctx; - var turn = []; - var xV = [-1, 0, 1, 0]; - var yV = [0, -1, 0, 1]; - var queue = []; - var elements = 1; - var map = []; - var X = 5 + (Math.random() * (45 - 10))|0; - var Y = 5 + (Math.random() * (30 - 10))|0; - var direction = Math.random() * 3 | 0; - var interval = 0; - var score = 0; - var inc_score = 50; - var sum = 0, easy = 0; - var i, dir; - var canvas = document.createElement('canvas'); + for (i = 0; i < 45; i++) { map[i] = []; } From 7e32279c78e6920bae7d993d725cf5e9ab91febb Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:13:05 -0600 Subject: [PATCH 11/27] Update index.html --- index.html | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 236a61a44..3bbc84e2d 100644 --- a/index.html +++ b/index.html @@ -104,23 +104,7 @@ ctx.clearRect(dir[0] * 10, dir[1] * 10, 10, 10); } } else if (!turn.length) { - if (confirm("You lost! Play again? Your Score is " + score)) { - ctx.clearRect(0, 0, 450, 300); - queue = []; - elements = 1; - map = []; - X = 5 + (Math.random() * (45 - 10))|0; - Y = 5 + (Math.random() * (30 - 10))|0; - direction = Math.random() * 3 | 0; - score = 0; - inc_score = 50; - for (i = 0; i < 45; i++) { - map[i] = []; - } - placeFood(); - } else { - window.clearInterval(interval); - } + reset(); } } interval = window.setInterval(clock, 60); @@ -150,6 +134,26 @@ } } + function reset(){ + if (confirm("You lost! Play again? Your Score is " + score)) { + ctx.clearRect(0, 0, 450, 300); + queue = []; + elements = 1; + map = []; + X = 5 + (Math.random() * (45 - 10))|0; + Y = 5 + (Math.random() * (30 - 10))|0; + direction = Math.random() * 3 | 0; + score = 0; + inc_score = 50; + for (i = 0; i < 45; i++) { + map[i] = []; + } + placeFood(); + } else { + window.clearInterval(interval); + } + } + From fcb6e52885c91e24193c4ef144b6c6c20ce86181 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:15:03 -0600 Subject: [PATCH 12/27] Update index.html --- index.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 3bbc84e2d..b7068b868 100644 --- a/index.html +++ b/index.html @@ -61,15 +61,6 @@ canvas.setAttribute('height', 30 * 10); ctx = canvas.getContext('2d'); document.body.appendChild(canvas); - function placeFood() { - var x, y; - do { - x = Math.random() * 45|0; - y = Math.random() * 30|0; - } while (map[x][y]); - map[x][y] = 1; - ctx.strokeRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2); - } placeFood(); function clock() { @@ -154,6 +145,16 @@ } } + function placeFood() { + var x, y; + do { + x = Math.random() * 45|0; + y = Math.random() * 30|0; + } while (map[x][y]); + map[x][y] = 1; + ctx.strokeRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2); + } + From 166c5ae82b5f369ce0605f6f999a804fbb90ff6a Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:16:46 -0600 Subject: [PATCH 13/27] Update index.html --- index.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index b7068b868..c0c7f5c29 100644 --- a/index.html +++ b/index.html @@ -125,6 +125,16 @@ } } + function placeFood() { + var x, y; + do { + x = Math.random() * 45|0; + y = Math.random() * 30|0; + } while (map[x][y]); + map[x][y] = 1; + ctx.strokeRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2); + } + function reset(){ if (confirm("You lost! Play again? Your Score is " + score)) { ctx.clearRect(0, 0, 450, 300); @@ -145,15 +155,7 @@ } } - function placeFood() { - var x, y; - do { - x = Math.random() * 45|0; - y = Math.random() * 30|0; - } while (map[x][y]); - map[x][y] = 1; - ctx.strokeRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2); - } + From 631954b5d0331d731379ca4bf5222f1f34918793 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:21:27 -0600 Subject: [PATCH 14/27] Update index.html --- index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index c0c7f5c29..ac353c6a8 100644 --- a/index.html +++ b/index.html @@ -51,6 +51,7 @@ var sum = 0, easy = 0; var i, dir; var canvas = document.createElement('canvas'); + var begin = 0; function init() { @@ -98,7 +99,9 @@ reset(); } } - interval = window.setInterval(clock, 60); + if (begin){ + interval = window.setInterval(clock, 60); + } document.onkeydown = function(e) { var code = e.keyCode - 37; /* @@ -155,6 +158,11 @@ } } + function start(){ + begin = 1; + reset(); + } + @@ -163,5 +171,6 @@

HTML5 SNAKE

+ From 2bc02da79be959d30861898d8cbc003247a99f81 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:24:25 -0600 Subject: [PATCH 15/27] Update index.html --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index ac353c6a8..a1af70a81 100644 --- a/index.html +++ b/index.html @@ -99,8 +99,9 @@ reset(); } } - if (begin){ - interval = window.setInterval(clock, 60); + interval = window.setInterval(clock, 60); + if(!begin){ + window.clearInterval(interval); } document.onkeydown = function(e) { var code = e.keyCode - 37; From cf83ca9b94872a1c57acd8dbf044d30fedbc993c Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:26:01 -0600 Subject: [PATCH 16/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index a1af70a81..7f8d300e9 100644 --- a/index.html +++ b/index.html @@ -172,6 +172,6 @@

HTML5 SNAKE

- + From 52d8e15d0cf5de54dcab029a7e61f60866e48377 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:30:45 -0600 Subject: [PATCH 17/27] Update index.html --- index.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 7f8d300e9..36ce3e9a2 100644 --- a/index.html +++ b/index.html @@ -100,9 +100,6 @@ } } interval = window.setInterval(clock, 60); - if(!begin){ - window.clearInterval(interval); - } document.onkeydown = function(e) { var code = e.keyCode - 37; /* @@ -127,6 +124,9 @@ } else if (dir === 218) easy = 1; } } + if(!begin){ + window.clearInterval(interval); + } } function placeFood() { @@ -161,7 +161,18 @@ function start(){ begin = 1; - reset(); + ctx.clearRect(0, 0, 450, 300); + queue = []; + elements = 1; + map = []; + X = 5 + (Math.random() * (45 - 10))|0; + Y = 5 + (Math.random() * (30 - 10))|0; + direction = Math.random() * 3 | 0; + score = 0; + inc_score = 50; + for (i = 0; i < 45; i++) { + map[i] = []; + } } From fb0ebd7a38cede7f19714a808b4971d6e81589f9 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:33:38 -0600 Subject: [PATCH 18/27] Update index.html --- index.html | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 36ce3e9a2..1419f1ee5 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,9 @@ ctx = canvas.getContext('2d'); document.body.appendChild(canvas); placeFood(); - + } + + function run() { function clock() { if (easy) { X = (X+45)%45; @@ -124,9 +126,6 @@ } else if (dir === 218) easy = 1; } } - if(!begin){ - window.clearInterval(interval); - } } function placeFood() { @@ -160,19 +159,7 @@ } function start(){ - begin = 1; - ctx.clearRect(0, 0, 450, 300); - queue = []; - elements = 1; - map = []; - X = 5 + (Math.random() * (45 - 10))|0; - Y = 5 + (Math.random() * (30 - 10))|0; - direction = Math.random() * 3 | 0; - score = 0; - inc_score = 50; - for (i = 0; i < 45; i++) { - map[i] = []; - } + run(); } From 5a66f501f34b7ff4c1246811f0116663d1b7730a Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:35:21 -0600 Subject: [PATCH 19/27] Update index.html --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 1419f1ee5..ddc8b9d6d 100644 --- a/index.html +++ b/index.html @@ -51,7 +51,6 @@ var sum = 0, easy = 0; var i, dir; var canvas = document.createElement('canvas'); - var begin = 0; function init() { @@ -62,10 +61,10 @@ canvas.setAttribute('height', 30 * 10); ctx = canvas.getContext('2d'); document.body.appendChild(canvas); - placeFood(); } function run() { + placeFood(); function clock() { if (easy) { X = (X+45)%45; From 44f3e0dd357755128bf9a4c86c212e68e53e78b4 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:42:23 -0600 Subject: [PATCH 20/27] Update index.html --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index ddc8b9d6d..33a11690e 100644 --- a/index.html +++ b/index.html @@ -51,6 +51,7 @@ var sum = 0, easy = 0; var i, dir; var canvas = document.createElement('canvas'); + var running = 0; function init() { @@ -64,6 +65,7 @@ } function run() { + running = 1; placeFood(); function clock() { if (easy) { @@ -158,7 +160,10 @@ } function start(){ - run(); + if (!running){ + window.clearInterval(interval); + run(); + } } From 67b46a4b6c6b63151a1bb4bd0256b0d511788f81 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:43:09 -0600 Subject: [PATCH 21/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 33a11690e..21728cb86 100644 --- a/index.html +++ b/index.html @@ -162,7 +162,7 @@ function start(){ if (!running){ window.clearInterval(interval); - run(); + setTimeout(run, 50); } } From 0747da1103021aff73093fa21ce353f3956ac028 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:45:48 -0600 Subject: [PATCH 22/27] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 21728cb86..461e26567 100644 --- a/index.html +++ b/index.html @@ -156,6 +156,7 @@ placeFood(); } else { window.clearInterval(interval); + running = 0; } } From 0af12256d096410817c3b1dec88374707d0f1a74 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:48:22 -0600 Subject: [PATCH 23/27] Update index.html --- index.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 461e26567..693f60dbf 100644 --- a/index.html +++ b/index.html @@ -140,19 +140,19 @@ } function reset(){ + ctx.clearRect(0, 0, 450, 300); + queue = []; + elements = 1; + map = []; + X = 5 + (Math.random() * (45 - 10))|0; + Y = 5 + (Math.random() * (30 - 10))|0; + direction = Math.random() * 3 | 0; + score = 0; + inc_score = 50; + for (i = 0; i < 45; i++) { + map[i] = []; + } if (confirm("You lost! Play again? Your Score is " + score)) { - ctx.clearRect(0, 0, 450, 300); - queue = []; - elements = 1; - map = []; - X = 5 + (Math.random() * (45 - 10))|0; - Y = 5 + (Math.random() * (30 - 10))|0; - direction = Math.random() * 3 | 0; - score = 0; - inc_score = 50; - for (i = 0; i < 45; i++) { - map[i] = []; - } placeFood(); } else { window.clearInterval(interval); From 5675448da33c28070132ae73e658564bba1ddc61 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:50:48 -0600 Subject: [PATCH 24/27] Update index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 693f60dbf..67f7241e9 100644 --- a/index.html +++ b/index.html @@ -147,12 +147,13 @@ X = 5 + (Math.random() * (45 - 10))|0; Y = 5 + (Math.random() * (30 - 10))|0; direction = Math.random() * 3 | 0; + tscore = score; score = 0; inc_score = 50; for (i = 0; i < 45; i++) { map[i] = []; } - if (confirm("You lost! Play again? Your Score is " + score)) { + if (confirm("You lost! Play again? Your Score is " + tscore)) { placeFood(); } else { window.clearInterval(interval); From 7a744380fc70082b1e63e1bfbe8830d43db47a58 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:54:01 -0600 Subject: [PATCH 25/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 67f7241e9..facd3bfc8 100644 --- a/index.html +++ b/index.html @@ -164,7 +164,7 @@ function start(){ if (!running){ window.clearInterval(interval); - setTimeout(run, 50); + setTimeout(run, 70); } } From 642c0e61d6d19bad241c3c0e03c61a02a5474ec0 Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 13:55:31 -0600 Subject: [PATCH 26/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index facd3bfc8..041f83013 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - HTML5 Snake + AWS Deployment Demo From 1b3a3f78368a4285139a1de4a9f55051f77004cd Mon Sep 17 00:00:00 2001 From: bhensel Date: Mon, 10 Dec 2018 14:03:51 -0600 Subject: [PATCH 27/27] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 041f83013..eee0361fa 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - AWS Deployment Demo + Hi Mike