Skip to content

Commit

Permalink
Added helpful text.
Browse files Browse the repository at this point in the history
  • Loading branch information
IdreesInc committed Aug 18, 2016
1 parent 52c8c7a commit 58ffed3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
22 changes: 21 additions & 1 deletion Tetris.html
Expand Up @@ -18,14 +18,34 @@
padding-left: 20%;
}
#score {
padding-left: 55%;
}
#instructions {
float: left;
position: absolute;
left: 1.5%;
bottom: 3%;
font-size: small;
line-height: 110%;
}
#signature {
float: right;
padding-right: 20%;
position: absolute;
right: 1.5%;
bottom: 3%;
font-size: small;
line-height: 110%;
}
a:link {
color: inherit;
}
</style>
</head>
<body>
<div id="output" class="text"></div>
<div id="score" class="text"></div>
<div id="instructions" class="text"><br />[Key Commands]<br />Move Shape: [Arrow Keys]<br />Rotate Shape: [Up Arrow]<br />Drop Shape: [Down Arrow]<br />Toggle AI: [A]<br />Speed Up: [E]<br />Slow Down: [D]<br />Save State: [Q]<br />Load State: [W]<br />Get Archive: [G]<br />Load Archive: [R]<br />Pick Shape: [I,O,T,S,Z,J,L]</div>
<div id="signature" class="text">Created By Idrees Hassan<br />Questions? Just ask!<br /><a href="mailto:&#105;&#100;&#114;&#101;&#101;&#115;&#064;&#105;&#100;&#114;&#101;&#101;&#115;&#105;&#110;&#099;&#046;&#099;&#111;&#109;" target="_top">&#105;&#100;&#114;&#101;&#101;&#115;&#064;&#105;&#100;&#114;&#101;&#101;&#115;&#105;&#110;&#099;&#046;&#099;&#111;&#109;</a></div>
<script src="./tetnet.js"></script>
<script type="text/javascript">
</script>
Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions tetnet.js
Expand Up @@ -132,12 +132,17 @@ window.onkeydown = function () {
} else if (characterPressed.toUpperCase() == "R") {
loadArchive(prompt("Insert archive:"));
} else if (characterPressed.toUpperCase() == "G") {
prompt("Archive from last generation (including from last session):", localStorage.getItem("archive"));
if (localStorage.getItem("archive") == null) {
alert("No archive saved. Archives are saved after a generation has passed, and remain across sessions. Try again once a generation has passed");
} else {
prompt("Archive from last generation (including from last session):", localStorage.getItem("archive"));
}
} else if (characterPressed.toUpperCase() == "F") {
inspectMoveSelection = !inspectMoveSelection;
} else {
return true;
}
output();
return false;
};

Expand Down Expand Up @@ -572,7 +577,7 @@ function transpose(array) {
function output() {
if (draw) {
var output = document.getElementById("output");
var html = "<h1>TetNet</h1><br />var grid = [";
var html = "<h1>TetNet</h1><h5>Evolutionary approach to Tetris AI</h5>var grid = [";
var space = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
for (var i = 0; i < grid.length; i++) {
if (i === 0) {
Expand Down

0 comments on commit 58ffed3

Please sign in to comment.