Ejemplo n.º 1
0
print $_GET["game"];
?>
</h1>
         </div>	   
          <div class="col-md-4">
            <?php 
print "<h2>Dag : " . $dag . "</h2>";
rasterservice::makeRaster($arrPrev, $grootte);
?>
          </div>
          <div class="col-md-4">
            <?php 
if ($nextday) {
    $dag = $dag + 1;
    print "<h2>Dag : " . $dag . "</h2>";
    $arrNext = gameService::nextStep($arrPrev);
    $_SESSION['nextStep'] = $arrNext;
    rasterservice::makeRaster($arrNext, $grootte);
}
?>
          </div>
          <div class="col-md-2">
          </div>
        </div>
      </div>
    </section>
    <!--Start sectie KNOPPEN-->			
    <section>			
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-4">
Ejemplo n.º 2
0
 public static function sortArray($array)
 {
     $games = gameService::getAllGames();
     foreach ($games as $game) {
         if ($game->id == $array[0]->gameid) {
             $grootte = $game->grootte;
         }
     }
     $arrNew = array();
     for ($i = 1; $i <= $grootte; $i++) {
         for ($j = 1; $j <= $grootte; $j++) {
             $org = organismeservice::checkPositionInArray($j, $i, $array);
             if ($org != null) {
                 array_push($arrNew, $org);
             }
         }
     }
     return $arrNew;
 }
Ejemplo n.º 3
0
<?php

$games = gameService::getAllGames();
$soorten = soortService::getAllSoorten();
foreach ($games as $game) {
    if ($game->id == $_GET["game"]) {
        $grootte = $game->grootte;
    }
}
print "<div class='matrix grootte" . $grootte . " clearFix'>";
for ($rij = 1; $rij <= $grootte; $rij++) {
    for ($kol = 1; $kol <= $grootte; $kol++) {
        $positie = organismeservice::checkPosition($kol, $rij, $_GET["game"]);
        if (isset($positie)) {
            $posSoort = $positie->soort;
            foreach ($soorten as $soort) {
                if ($soort->id == $posSoort) {
                    $imgtitle = $soort->soort;
                    $imgsrc = $soort->image;
                }
            }
            if ($posSoort == "1") {
                $kracht = "";
            } else {
                $kracht = "Kracht:" . $positie->kracht;
            }
            print "<div class='cell'><div class='innercell'><img src='" . $imgsrc . "' alt='" . $imgtitle . "'><span class='tooltip'>" . $imgtitle . " " . $kracht . "</span></div></div>";
        } else {
            print "<div class='cell'><div class='innercell'></div></div>";
        }
    }
Ejemplo n.º 4
0
require_once "business/soortservice.php";
require_once "business/rasterservice.php";
require_once "business/playservice.php";
session_start();
// DELETE GAME
if (isset($_GET['deletegame'])) {
    $game = GameDAO::deleteGame($_GET['deletegame']);
}
// CHECK FOR POST
if (isset($_POST["grootte"])) {
    gameService::initNewGame($_POST["grootte"]);
    header('Location:index.php');
    die;
}
// MAAK GAMELIJST AAN
$gamelijst = gameService::getAllGames();
if (!isset($_GET['page']) && !isset($_GET['game'])) {
    include 'presentation/homepage.php';
}
if (isset($_GET['nextstep']) && isset($_GET['game'])) {
    if (isset($_SESSION['nextStep'])) {
        $game = GameDAO::getGameFromId($_GET['game']);
        playservice::play($game, $_SESSION['nextStep']);
    }
}
if (isset($_GET['game'])) {
    $game = GameDAO::getGameFromId($_GET['game']);
    if (isset($game)) {
        $arrGameOrganismen = organismeservice::getAllOrganismen($_GET['game']);
        include 'presentation/game.php';
    }