示例#1
0
<?php

$folder_ext = "";
require_once $folder_ext . 'php/helper.php';
$js_array = array("jquery-1.11.2.min.js", "js/controller.js", "js/ai.js", "View/pixi.dev.js", "View/square.js", "View/checker.js", "View/CheckerBoardView.js", "Groupplay/js/timer.js");
$head_input = createHeadContent("Checkers VS AI", "", "css/style.css", $js_array);
$js_input = createDefaultJs();
echo <<<HTML_TEXT
<!DOCTYPE html>
<html>
<head>
{$head_input}

<script type="text/javascript">
{$js_input}

var gameMode;

\tfunction runGame(difficulty) { \$(function ()
\t{
\t\tgameMode = difficulty;
\t\tchecker_board = new CheckerBoardView();
\t\tgame.stopAiMove();
\t\tgame = new CheckersGame(checker_board, gameMode, {msgfunc: change_message});
\t\t

\t\t\$("#game_status").show();
        \$("#restart_button").show();

\t\tchecker_board.init_board(game.clickPiece, game.clickSquare, get_canvas_size());
\t
示例#2
0
<?php

$folder_ext = "";
require_once $folder_ext . 'php/helper.php';
$head_input = createHeadContent("Checkers", "", "css/style.css", NULL);
echo <<<HTML_TEXT
<!DOCTYPE html>
<html>
<head>
{$head_input}
</head>
<body>
<div id="page-container">
\t<header>
\t\t<h1>Welcome to Checkers!</h1>
\t\t<p>There are three different gameplay type of this classic game.  Click on a category below to begin playing.</p>
\t</header>
\t<section class="selection-container">
\t\t<section class="play-group">
\t\t\t<a href="local.php">
\t\t\t\t<h2>Local Play</h2>
\t\t\t\t<p>Play against a buddy on the same computer.  Each player will take a turn and wait for the other player to complete their turn.</p>
\t\t\t\t<div class="button">Play Local Game</div>
\t\t\t</a>
\t\t</section>
\t\t<section class="play-group">
\t\t\t<a href="ai.php">
\t\t\t\t<h2>AI Play</h2>
\t\t\t\t<p>Compete against the computer in this AI driven game.  The AI is set to medium difficulty and plays the blue team.</p>
\t\t\t\t<div class="button">Play Against AI</div>
\t\t\t</a>
示例#3
0
<?php

$folder_ext = "";
require_once $folder_ext . 'php/helper.php';
$js_array = array("jquery-1.11.2.min.js", "js/controller.js", "js/ai.js", "View/pixi.dev.js", "View/square.js", "View/checker.js", "View/CheckerBoardView.js", "Groupplay/js/timer.js");
$head_input = createHeadContent("Checkers Group Play", "", "css/style.css", $js_array);
$js_input = createDefaultJs();
echo <<<HTML_TEXT
<!DOCTYPE html>
<html>
<head>
{$head_input}

<script type="text/javascript">
{$js_input}\t
\tfunction startGroupPlay(board, team)
\t{
\t\tchecker_board = new CheckerBoardView();
\t\tgame = new CheckersGame(checker_board, 3, {msgfunc: change_message, submitmoves: submitMoves, board: board, currentTeam: team, userTeam: \$('input[name=teamInput]:checked').val()});
\t\tchecker_board.init_board(game.clickPiece, game.clickSquare, get_canvas_size(), board);
\t
\t
\t\t//document.getElementById("move_it").onclick = move_checker_button;
\t\t//document.getElementById("delete_it").onclick = delete_checker_button;
\t\t\$("#game").html(checker_board.get_renderer_view());
\t
\t\t\$("#gamepicker").hide();
\t\t\$("#gametable").show();
        get_canvas_size();
\t\t\$("#groupplay_start").show();
\t\t\$("#groupplay").hide();