Skip to content

Commit

Permalink
Added snake.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncbowers committed Sep 7, 2018
1 parent 9d9d8b2 commit 2625af3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
13 changes: 13 additions & 0 deletions framework/games/snake.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@

function githubAccount() {
return "nickrhalvorsen";
}

function userpic() {
return "halvorsenn.jpeg"
}

function graddate() {
return "JMU '19";
}

function gameMessageHandler(msg) {

}
Expand Down
Binary file added framework/img/coders/halvorsenn.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions framework/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<nav id="main-nav">
<ul>
<li><a onclick="startInteraction();">Interact With Current Screen</a></li>
<li><a onclick="loadGame('snake');startInteraction();">Snake</a></li>
<li><a onclick="loadGame('splash-sketch');startInteraction();">Circles of Circles</a></li>
<li><a onclick="loadGame('draw');startInteraction();">Draw with friends</a></li>
</ul>
Expand Down
16 changes: 16 additions & 0 deletions framework/lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ function playCode(code) {
if (typeof touchStart !== "undefined") { touchStartHandler = touchStart; }
if (typeof touchMove !== "undefined") { touchMoveHandler = touchMove; }
if (typeof touchEnd !== "undefined") { touchEndHandler = touchEnd; }

if (typeof githubAccount !== "undefined" && typeof userpic !== "undefined") {

$("#slides").hide();
$("#branding").hide();
$("#url").hide();

$("#usericon").html("<img style=\"width: 50px; height=50px; border-radius: 25px;\" src=\"img/coders/" + userpic() + "\" />");
$("#github").text(githubAccount());

if (typeof graddate !== "undefined") {
$("#graddate").text(graddate());
}
$("#shoutout").show();
// $("#shoutout").show();
}
}

var fxns = p5functions;
Expand Down
17 changes: 13 additions & 4 deletions framework/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
</div>
</div>

<div id="shoutout" style="z-index: 200; margin-top: 0; right: 100px; position:fixed; background-color: rgba(0,0,0,200.0); padding: 0.25em; font-size: 14pt; display:none;">
<p style="text-align: center; padding-left: 0.5em; padding-right: 0.5em;">Designed by:</p>
<p id="usericon" style="text-align: center;"></p>
<p style="text-align: center; padding-bottom:0;margin-bottom: 0; font-size: 10pt;">GitHub</p>
<p id="github" style="vertical-align: middle; text-align: center;margin-top:0;margin-bottom: 0; padding-bottom:0;"></p>
<p id="graddate" style="vertical-align: middle; text-align: center; margin-top:0; margin-bottom: 0; font-size: 10pt; padding-bottom:0;"></p>
</div>

<h1 id="branding" style="z-index: 200; margin-bottom: 0; left: 0.5em; position:fixed;" class="bottom">
JMU CompSci
</h1>
Expand Down Expand Up @@ -149,10 +157,11 @@ <h1 id="branding" style="z-index: 200; margin-bottom: 0; left: 0.5em; position:f
var searchString = window.location.search.substring(1);
var variableArray = searchString.split('&');
fileName = getUrlValue("sketch");
currentSlideIndex = getUrlValue("slide");
if (currentSlideIndex == undefined) {
currentSlideIndex = 0;
}
// currentSlideIndex = getUrlValue("slide");
// if (currentSlideIndex == undefined) {
// currentSlideIndex = 0;
// }
currentSlideIndex = 0;

if (fileName == undefined) {
fileName = "splash-sketch";
Expand Down

0 comments on commit 2625af3

Please sign in to comment.