Browse Source

Added zombies to the header menu and created games.php

pull/1/head
jrtechs 7 years ago
parent
commit
a74f2e3561
6 changed files with 66 additions and 20 deletions
  1. +22
    -0
      games.php
  2. +9
    -9
      games/bamboofield.html
  3. +7
    -6
      games/zombiePanda.html
  4. +24
    -0
      games/zombiePanda.php
  5. +4
    -4
      includes/header.php
  6. +0
    -1
      user/profile.php

+ 22
- 0
games.php View File

@ -0,0 +1,22 @@
<?php
//5-16-17
//ini_set('display_errors', 1);
include 'includes/header.php';
echo '<br><div class="w3-row">
<div class="w3-half w3-container ">';
include('games/bamboofield.html');
echo '</div><div class="w3-half w3-container">';
include('games/zombiePanda.html');
echo '</div>';
echo '</div>';
include 'includes/footer.php';
?>

+ 9
- 9
games/bamboofield.html View File

@ -2,18 +2,18 @@
window.onload = function()
{
var canvas = document.getElementById("canvas");
var canvasBFc = document.getElementById("canvasBF");
var c = canvas.getContext('2d');
var c = canvasBFc.getContext('2d');
c.fillStyle= "black";
c.fillRect(0,0, canvas.width, canvas.height);
c.fillRect(0,0, canvasBFc.width, canvasBFc.height);
};
//entire game
function play()
function playBF()
{
var animate = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback)
{
@ -21,15 +21,15 @@
};
var canvas = document.getElementById("canvas");
var canvasBFc = document.getElementById("canvasBF");
var width = 700;
var height = 700;
canvas.style.textAligh = 'center';
canvasBFc.style.textAligh = 'center';
var context = canvas.getContext('2d');
var context = canvasBFc.getContext('2d');
@ -294,5 +294,5 @@
}
</script>
<div><canvas id="canvas" width="700" height="700"></canvas></div>
<div><input type="submit" name="play" value="Play Game" onclick="this.blur();play()"/></div>
<div><canvas id="canvasBF" width="700" height="700"></canvas></div>
<div><input type="submit" name="play" value="Play Game" onclick="this.blur();playBF()"/></div>

+ 7
- 6
games/zombiePanda.html View File

@ -1,18 +1,18 @@
<script>
window.onload = function()
{
var canvas = document.getElementById("canvas");
var canvas = document.getElementById("canvasZP");
var c = canvas.getContext('2d');
c.fillStyle= "black";
c.fillRect(0,0,canvas.width,canvas.height);
};
function play()
function playZP()
{
var animate = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) {
window.setTimeout(callback, 1000 / 60)
};
var canvas = document.getElementById("canvas");
var canvas = document.getElementById("canvasZP");
var width = 700;
var height = 700;
canvas.style.textAlign = 'center';
@ -349,7 +349,6 @@
animate(tic);
}
window.addEventListener("keydown", function (event)
{
if(event.keyCode >=37 && event.keyCode <=40)
@ -372,5 +371,7 @@
</script>
<div><input type="submit" name="play" value="Play Game" onclick="this.blur();play()"/></div>
<div><canvas id="canvas" width="700" height="700"></canvas></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>

+ 24
- 0
games/zombiePanda.php View File

@ -0,0 +1,24 @@
<?php
//5-16-17
$dir = 2;
include '../includes/header.php';
echo '<br><div class="w3-row">
<div class="w3-twothird w3-container ">';
include('zombiePanda.html');
echo '</div><div class="w3-third w3-container">';
//high scores
include('../includes/profile.php');
echo '</div>';
echo '</div>';
include '../includes/footer.php';
?>

+ 4
- 4
includes/header.php View File

@ -68,7 +68,7 @@
<i class="fa fa-remove"></i>
</a>
<a href="bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
<a href="#" class="w3-bar-item w3-button">Link 2</a>
<a href="zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
<a href="#" class="w3-bar-item w3-button">Link 3</a>
<a href="#" class="w3-bar-item w3-button">Link 4</a>
<a href="#" class="w3-bar-item w3-button">Link 5</a>
@ -85,7 +85,7 @@
<button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
<div class="w3-dropdown-content w3-card-4 w3-bar-block">
<a href="bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
<a href="#" class="w3-bar-item w3-button">Link</a>
<a href="zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
<a href="#" class="w3-bar-item w3-button">Link</a>
</div>
</div>
@ -127,7 +127,7 @@
<i class="fa fa-remove"></i>
</a>
<a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
<a href="#" class="w3-bar-item w3-button">Link 2</a>
<a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
<a href="#" class="w3-bar-item w3-button">Link 3</a>
<a href="#" class="w3-bar-item w3-button">Link 4</a>
<a href="#" class="w3-bar-item w3-button">Link 5</a>
@ -144,7 +144,7 @@
<button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
<div class="w3-dropdown-content w3-card-4 w3-bar-block">
<a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
<a href="#" class="w3-bar-item w3-button">Link</a>
<a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
<a href="#" class="w3-bar-item w3-button">Link</a>
</div>
</div>

+ 0
- 1
user/profile.php View File

@ -1,6 +1,5 @@
<?php
//ini_set('display_errors', 1);
$errors = array();
if(isset($_POST['logout']))

Loading…
Cancel
Save