Location: PHPKode > projects > PHP- RPGRTS > map/index.php
<?php
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');
define("IS_GD_MAP", 0);
define("NO_CHECKS", 0);
define("ADMIN_PAGE", 0);

$load = array("map" => 1, "sql" => 1, "player" => 1, "template" => 1, "auth" => 1);
include("system/init.php");
$map->load_objects_into_array();
$map->load_terrain();
if(!empty($_GET['move']))
{
	$player->update_pos($_SESSION['u_id']);
}
$player->can_move();
$map->get_objects_on_screen($player->u_position['x'], $player->u_position['y']);
$map->get_users_on_screen($player->u_position['x'], $player->u_position['y']);
$map->load_objects_into_array();

if(!empty($_GET['action']))
{
	switch($_GET['action'])
	{
		case "pickup":
		$player->pickup_object($_POST['pick_up']);
		break;
		case "drop":
		$player->drop_object($_POST['drop']);
		break;
		case "use":
		$player->use_object($_POST['use']);
		break;
	}
	$map->load_objects_into_array();
	$player->can_move();
}

$map->makemap($player->u_position['x'], $player->u_position['y']);
$map->generate_map_to_array($player->u_position['x'], $player->u_position['y']);

$map->get_users_in_tile($player->u_position['x'], $player->u_position['y']);
$player->make_inventry($_SESSION['u_id']);
$player->make_actions($_SESSION['u_id']);

$gen->header();
$gen->footer();
$display->display_buffer("header");
$display->display_buffer("map");
$display->display_buffer("actions");
$display->display_buffer("inventry");
$display->display_buffer("users");
$display->display_buffer("footer");
$sql->close();
?>
Return current item: PHP- RPGRTS