本文整理汇总了PHP中Game::createGame方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::createGame方法的具体用法?PHP Game::createGame怎么用?PHP Game::createGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::createGame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
die("We are currently upgrading EVERYTHING - We should be up soon!");
session_start();
$whitelist = array('replay');
require 'controller/dbsettings.php';
//create game
error_reporting(E_ALL);
ini_set('display_errors', 1);
Game::createGame($replay);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Start a Game</title>
<link rel="stylesheet" href="style/global.css">
<link rel="stylesheet" href="style/startQuiz.css">
<script src="http://autobahn.s3.amazonaws.com/js/autobahn.min.js"></script>
<script src="scripts/startQuiz.js"></script>
<script src="scripts/mapdata.js"></script>
<script src="scripts/continentmap.js"></script>
<script src="scripts/global.js"></script>
<script src="scripts/socketScripts.js"></script>
<script src="scripts/cloud.js"></script>
<script src="scripts/jquery.js"></script>
示例2: session_start
<?php
session_start();
//$_SESSION = array();
//$_SESSION["auto"]="";
require 'controller/dbsettings.php';
//create game
Game::createGame();
//die ($_SESSION["auto"]);
?>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/global.css">
<link rel="stylesheet" href="style/joinQuiz.css">
<link rel="stylesheet" href="style/startQuiz.css">
<script src="mapdata.js"></script>
<script src="continentmap.js"></script>
<script src="http://autobahn.s3.amazonaws.com/js/autobahn.min.js"></script>
<script src="socketScripts.js"></script>
<script src="scripts/startQuiz.js"></script>
<script src="scripts/music.js"></script>
<script>
window.onload = function() {
//alert($("#qInfoLocation").height());
示例3: createGame
public function createGame($level)
{
$game = $this->games()->save(new Game(['level_id' => $level->id, 'game' => Game::createGame($level)]));
return $game;
}
示例4: array
<?php
require '../controller/dbsettings.php';
include '../controller/siteFunctions.php';
include '../controller/Question.php';
include '../controller/Game.php';
include '../controller/Answer.php';
include '../controller/User.php';
//$sql = "DELETE FROM `questionsSingle`";
$result = $conn->query($sql);
$_SESSION["single"] = true;
$playedGames = array();
$_SESSION["regionsSelected"] = $regionsSelected = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
$gamesSelected = array("time", "weather", "pt", "places", "places", "facts", "facts", "geo", "geo", "geo", "geo", "geo");
//$gamesSelected=array("time","weather");
Game::createGame(false, true);
$_SESSION["questionNumber"] = getLastQuestion() + 1;
echo $_SESSION["questionNumber"] . "<Br>Starting";
while (true) {
if (sizeof($playedGames) == 0) {
$current = $gamesSelected[rand(0, count($gamesSelected) - 1)];
} else {
$idealArray = array_count_values($gamesSelected);
$currentArray = array_count_values($playedGames);
$current = $gamesSelected[rand(0, count($gamesSelected) - 1)];
while (array_key_exists($current, $currentArray) && $currentArray[$current] / sizeof($playedGames) > $idealArray[$current] / sizeof($gamesSelected)) {
//echo ("current". $current.($currentArray[$current]/sizeof($playedGames)));
$current = $gamesSelected[rand(0, count($gamesSelected) - 1)];
}
//
}