Skip to content

Commit

Permalink
Added instructions for game (Closes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtechs committed Sep 5, 2019
1 parent 0050dac commit 6804afa
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions nodeGame/gamePage.html
Expand Up @@ -24,6 +24,8 @@
c.fillRect(0,0,canvas.width,canvas.height);
};


//increments score on server
function sendStonks()
{
$.ajax({
Expand All @@ -36,6 +38,7 @@
}


//resets score on server
function sendNotStonks()
{
$.ajax({
Expand Down Expand Up @@ -86,7 +89,7 @@

this.render = function()
{
context.fillStyle = "rgba(0, 45, 160, 1)"; //green
context.fillStyle = "rgba(188, 19, 254, 1)"; //purple
context.fillRect(this.x, this.y, this.width,this.height);
}

Expand Down Expand Up @@ -357,13 +360,13 @@
context.font= "20px Georgia";
context.fillText("You died with a score of " + score,200,340);

if(!deadForGood)
{
deadForGood = true;
setTimeout(function()
{
location.replace("/endGame");
}, 2000);
if(!deadForGood)
{
deadForGood = true;
setTimeout(function()
{
location.replace("/endGame");
}, 2000);
}
}
else
Expand Down Expand Up @@ -394,6 +397,15 @@

</script>


<div>
<h3>Instructions:</h3>
<p>
Arrow keys/wasd to move and space key to shoot.
</p>
</div>


<div><canvas id="canvasZP" width="700" height="700"></canvas></div>
<div><input type="submit" name="play" value="Play Game" onclick="
this.blur();playZP()"/></div>
Expand Down

0 comments on commit 6804afa

Please sign in to comment.