Newer
Older
<?php
class Game1SignupMethod extends SignupMethod {
public static function getName() {
}
public static function getAltText() {
return "Ein Spiel mit Rittern, Schloss und Dorf! [Empfohlene Methode]";
}
public static function getMetaInfo() {
return [
return ['../../js/jquery-1.11.1.min.js', '../../js/jquery-ui.min.js', 'jslib/d3.min.js', 'jslib/priority-queue.min.js', 'jslib/checkLineIntersection.js',

Tim Repke
committed
'js/events.js', 'js/achievements.js', 'js/svgUtils.js', 'js/pathFinder.js', 'js/vector.js', 'js/character.js', 'js/camera.js',
'js/environment.js', 'js/story.js', 'js/game.js'];
}
public function getAdditionalHeader() {
return '';
}
public function showInlineHTML() {

Tim Repke
committed
$environment = Environment::getEnv();
$dates = comm_get_possible_dates($environment->database, $environment->getSelectedTripId());
foreach ($dates as &$date)
$date = '"' . $date . '"';
echo '
<script type="text/javascript">
var env_possible_dates = [' . implode(', ', $dates) . '];
</script>';
<div id="game-sidebar" class="bordered-box">
<div class="sidebar-section">
<div class="sidebar-section-head">Game log</div>
<div class="sidebar-log"><div>
<ul id="game-log">
<li>Gehe in das Schloss!</li>
<li>Bestes Anmeldesystem aller Zeiten gestartet!</li>
</ul>
</div></div>
</div>
<div class="sidebar-section">
<div class="sidebar-section-head">Achievements</div>
<div class="status-bar" id="achievement-progress" style="margin-bottom: 0.5em"><span style="width:25%" class="status-bar-bar"></span> <div class="status-bar-text">5/43</div> </div>
<div class="sidebar-log"><div>
<div id="gameCanvas">
<div id="game-overlay" class="loading"></div>
<div id="gameDialogue" class="bordered-box"></div>
g_smallValue = 0.000001; // fun with floats
var FAPI = new FAPI();
var game = new Game({

Manuel Herrmann
committed
startMap: \'map_landing\',
showEventLayers: false,
pathFindingGridSize: 5,
usePathFinding: true,
size: [800, 600]
});

Manuel Herrmann
committed
$(function() {
game.run();
// this following stuff is to prevent the page from scrolling, when the user
// actually just wants to scroll inside the logs.
// it removes the main scrollbar and adds a padding of its size to replace the space

Tim Repke
committed
var scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
var x = document.getElementsByClassName("sidebar-log");
for (var i = 0; i < x.length; i++) {
x[i].addEventListener("mouseout", function(){
document.body.style.overflow=\'auto\';
document.body.style.paddingRight = "0px";
}, false);
x[i].addEventListener("mouseover", function(){
document.body.style.overflow=\'hidden\';
document.body.style.paddingRight = scrollbarWidth+"px";
}, false);
}

Manuel Herrmann
committed
});