initial commit
This commit is contained in:
24
map/includes/mapmove_class.php
Normal file
24
map/includes/mapmove_class.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?
|
||||
class TMapmove {
|
||||
public
|
||||
$cur_pos=array(0,0);
|
||||
function __construct() {
|
||||
}
|
||||
function __destruct() {
|
||||
}
|
||||
function move_to($x,$y) {
|
||||
$this->cur_pos=array($this->cur_pos[0]+$x,$this->cur_pos[1]+$y);
|
||||
}
|
||||
function paint() {
|
||||
for ($i=$this->cur_pos[0]-5;$i<$this->cur_pos[0]+6;$i++) {
|
||||
for ($j=$this->cur_pos[1]-5;$j<$this->cur_pos[1]+6;$j++) {
|
||||
if ($i==$this->cur_pos[0] && $j==$this->cur_pos[1]) echo "<u><b>";
|
||||
if (!file_exists('./map/'.$j.'x'.$i)) {echo 0; }
|
||||
else { $l=file('./map/'.$j.'x'.$i); echo $l[0]; }
|
||||
if ($i==$this->cur_pos[0] && $j==$this->cur_pos[1]) echo "</b></u>";
|
||||
}
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
12
map/index.php
Normal file
12
map/index.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
include_once('includes/mapmove_class.php');
|
||||
echo "<body style='font-family:monospace;'>";
|
||||
$map = new TMapmove();
|
||||
$map->cur_pos=array(0,0);
|
||||
//$c=array(0,0);
|
||||
$map->paint();
|
||||
$map->move_to(1,1);
|
||||
$map->paint();
|
||||
echo "</body>";
|
||||
?>
|
||||
1
map/map/-4x2
Normal file
1
map/map/-4x2
Normal file
@@ -0,0 +1 @@
|
||||
*
|
||||
1
map/map/-4x9
Normal file
1
map/map/-4x9
Normal file
@@ -0,0 +1 @@
|
||||
*
|
||||
1
map/map/0x0
Normal file
1
map/map/0x0
Normal file
@@ -0,0 +1 @@
|
||||
^
|
||||
1
map/map/2x4
Normal file
1
map/map/2x4
Normal file
@@ -0,0 +1 @@
|
||||
~
|
||||
Reference in New Issue
Block a user