1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
 
/*
 
DEVELOPED BY: Scott: coderprofile.com/coder/VBAssassin
VERSION: 1.00 Alpha
 
1. Fixed a few bugs in the reseting of the game
2. The winner of the game has the board filled in in their colour
3. Checks to see if a player is blocked in and do the required action
 
Once this is ok, then i will release it as v1.00
 
Then work on v2 where sessions will be replaced with a database and people will be able to play against other people over the net.
 
Also wouldn't mind adding some AJAX to it to prevent the page reloads.
 
*/
 
include_once('classes/slime_wars_core.php');
include_once('classes/slime_wars.php');
 
 
session_start();
$game = new slime_wars(7, 7, isset($_GET['reset']) ? true : false);
 
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
       <head>
              <title>Slime Wars - v0.03 Alpha</title>
              <?php print $game->get_javascript(); ?>
       </head>
       <body>
              <table width='100%' cellspacing='0' cellpading='0' style='margin-bottom:20px;'>
                     <tr>
                            <td width='1%' valign='top'><?php print $game->render_board(); ?></td>
                            <td width='99%' valign='top' style='padding-left:20px;'>
                                   <span style='font-size:30px;'>Blue: <?php $results = $game->get_players_slime_counts(); print $results[1]; ?><br />
                                   Red: <?php print $results[2]; ?></span><br />
                                   <br /><br />
                                   <?php print $game->get_reset_button(); ?>
                            </td>
                     </tr>
              </table>
       </body>
</html>