Пример #1
0
 function __construct($parent = null, $params_json = "")
 {
     $this->stat = false;
     $this->control = false;
     $this->physics = false;
     parent::__construct($parent, $params_json);
 }
Пример #2
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->x = -78;
     $this->y = 78;
     $this->z = -10;
     $num = 0;
     if (isset($parent->houses)) {
         $num = count($parent->houses);
     }
     $this->x += $num * 51;
     $this->js = "";
     $this->render = true;
     $this->target = "";
     parent::__construct($parent, $params_json);
     //var_dump( find( root( $this ), "Game" )->interactive );
     if (find(root($this), "Game")->interactive != 'false') {
         $this->js = "house_click";
     }
     if ($this->render) {
         find(root($this), "Bank")->amount -= $parent->cost;
     }
     //unique name
     $this->name = "house" . $parent->id . $this->id;
     //set new target based on new name
     $this->target = $this->name;
     //recalculate guid based on new name
     //$this->guid = md5( serialize( clean( $this ) ) );
 }
Пример #3
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
     $this->add(new Script($this, '{ "path":"threejs/examples/js/Detector.js", "region":"head" }'));
     $this->add(new Script($this, '{ "path":"threejs/examples/js/renderers/Projector.js", "region":"head" }'));
     $this->add(new Script($this, '{ "path":"threejs/examples/js/renderers/CanvasRenderer.js", "region":"head" }'));
 }
Пример #4
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->x = 0;
     $this->z = 0;
     $this->rotation = 0;
     $this->label = "";
     $this->type = "";
     $this->city = "";
     $this->cost = 0;
     $this->profit = 0;
     $this->houses = array();
     $this->js = "";
     $this->target = "";
     parent::__construct($parent, $params_json);
     $game = find($this->root(), "Game");
     //var_dump( $game );
     if ($this->cost and $game->interactive) {
         $this->js = "street_click";
     }
     //var_dump( $this->id );
     //var_dump( count( $parent->streets ) );
     /* get houses from db */
     //var_dump( clean( $this ) );
     //var_dump( root( $this ) );
     $this->target = $this->name;
     $db_houses = root($this)->db->load("House", "parent", $this->name);
     //var_dump( $this->name . " " . count( $db_houses ) );
     if (count($db_houses)) {
         foreach ($db_houses as $db_house) {
             $this->add(new House($this, $db_house->object));
         }
     }
     //var_dump( $db_houses );
     //$this->parent->add( new Script( $this->parent, '{ "path":"tpl/js/house.js", "region":"head" }' ) );
 }
Пример #5
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
     //$this->add( new Script( $this, '{ "path":"threejs/threex/vendor/oimo.js", "region":"head" }' ) );
     //$this->add( new Script( $this, '{ "path":"threejs/threex/threex.oimo.js", "region":"head" }' ) );
     //$this->add( new Script( $this, '{ "path":"threejs/threex/threex.oimo.js", "region":"head" }' ) );
 }
Пример #6
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->name = "Test project";
     parent::__construct($parent, $params_json);
     if (isset($_SERVER["QUERY_STRING"]) and $_SERVER["QUERY_STRING"] != "") {
         $this->path = substr($_SERVER["QUERY_STRING"], 1);
     } else {
         $this->path = "index";
     }
     $this->session = new Session($this, '{}');
     $this->db = new DB($this, '{ "host":"' . HOST . '", "database":"' . DB . '", "user":"******", "pass":"******" }');
     $this->user = new User($this, '{}');
     $this->call = new Call($this, '{}');
     /* system scripts */
     $this->add(new Style($this, '{ "path":"styles", "region":"head" }'));
     $this->add(new Script($this, '{ "path":"threephp/js/jquery-1.11.2.min.js", "region":"head" }'));
     $this->add(new Script($this, '{ "path":"script", "region":"head" }'));
     $this->add(new Script($this, '{ "path":"main", "region":"footer" }'));
     /* system pages */
     $this->add(new Page($this, '{ "name":"Styles", "file":"threephp/tpl/styles.php", "path":"styles", "all":false }'));
     $this->add(new Page($this, '{ "name":"Scripts head", "file":"threephp/tpl/scripts.php", "path":"script", "all":false }'));
     $this->add(new Page($this, '{ "name":"Scripts footer", "file":"threephp/tpl/scripts.php", "path":"main", "all":false }'));
     $this->add(new Page($this, '{ "name":"Login", "file":"threephp/tpl/login.php", "path":"login" }'));
     $this->add(new Page($this, '{ "name":"Highscore", "file":"threephp/tpl/highscore.php", "path":"highscore" }'));
     $this->add(new Page($this, '{ "name":"Call", "file":"threephp/tpl/call.php", "path":"call", "all":false }'));
     $this->add(new Page($this, '{ "name":"Console", "file":"threephp/tpl/console.php", "path":"console", "all":false }'));
 }
Пример #7
0
 function __construct($parent = null, $params_json = "")
 {
     $this->host = "localhost";
     $this->user = "******";
     $this->pass = "";
     $this->db = "threedb";
     parent::__construct($parent, $params_json);
 }
Пример #8
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->x = 0;
     $this->y = 0;
     $this->rotation = 0 - M_PI / 2;
     $this->js = "";
     //"board_click";
     parent::__construct($parent, $params_json);
 }
Пример #9
0
 function __construct($parent = null, $params_json = "")
 {
     parent::__construct($parent, $params_json);
     if (isset($_COOKIE["threephp"])) {
         $this->cookie = $_COOKIE["threephp"];
     } else {
         $this->cookie = md5(uniqid(rand(), true));
         setcookie("threephp", $this->cookie, 0, "/");
     }
 }
Пример #10
0
 function __construct($parent = null, $params_json = "")
 {
     $this->secure = false;
     $this->name = "Test page";
     $this->path = "";
     $this->file = "";
     $this->all = true;
     parent::__construct($parent, $params_json);
     if ($this->secure) {
         //check project user
     }
 }
Пример #11
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->interactive = true;
     $this->game = 0;
     $this->round = 0;
     parent::__construct($parent, $params_json);
     $this->name = "game";
     $db_dices = root($this)->db->load("Dice");
     if (count($db_dices)) {
         $this->interactive = false;
     }
 }
Пример #12
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->name = "light";
     $this->color = 0xdfebff;
     $this->x = 300;
     $this->y = 500;
     $this->z = -250;
     $this->shadow = true;
     $this->box = false;
     $this->size = 2048;
     parent::__construct($parent, $params_json);
 }
Пример #13
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->dice1 = 6;
     $this->dice2 = 6;
     $this->js = 'dice_roll';
     $this->numhouses = 0;
     parent::__construct($parent, $params_json);
     find($this->root(), "Scene")->physics = true;
     $this->name = "dice";
     //load last value??
     $db_dices = root($this)->db->load("Dice", "", "", true);
     if (count($db_dices)) {
         $dice = json_decode($db_dices[0]->object);
         $this->dice1 = $dice->dice1;
         $this->dice2 = $dice->dice2;
     }
 }
Пример #14
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->resize = false;
     $this->stat = false;
     $this->click = false;
     //$this->info = false;
     $this->control = false;
     $this->tween = false;
     $this->physics = false;
     parent::__construct($parent, $params_json);
     $this->name = "scene";
     $this->add(new Script($this, '{ "path":"threejs/build/three.min.js", "region":"head" }'));
     $this->add(new Camera($this, '{}'));
     $this->add(new Renderer($this, '{}'));
     $this->add(new Ambient($this, '{}'));
     $this->add(new Light($this, '{}'));
     if ($this->resize) {
         $this->add(new Resize($this, '{}'));
     }
     if ($this->stat) {
         $this->add(new Stat($this, '{}'));
     }
     if ($this->click) {
         $this->add(new Click($this, '{}'));
     }
     //if( $this->info ):
     //	$this->add( new Info( $this, '{}' ) );
     //endif;
     if ($this->control) {
         $this->add(new Control($this, '{}'));
     }
     if ($this->tween) {
         $this->add(new Tween($this, '{}'));
     }
     if ($this->physics) {
         $this->add(new Physics($this, '{}'));
     }
     $this->add(new Animate($this, '{ "stat":"' . $this->stat . '", "control":"' . $this->control . '", "physics":"' . $this->physics . '" }'));
 }
Пример #15
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->color = 0x666666;
     //$this->x = -400;
     $this->y = 3;
     //$this->z = -400;
     $this->rotation = 0 - M_PI / 2;
     $this->position = 0;
     $this->target = 0;
     $this->js = "";
     parent::__construct($parent, $params_json);
     $this->name = "pawn";
     //load all dices from db and base position on it
     //in separate function
     $db_dices = root($this)->db->load("Dice");
     if (count($db_dices)) {
         if ($this->root()->path == "call") {
             array_pop($db_dices);
         }
         if (count($db_dices)) {
             foreach ($db_dices as $db_dice) {
                 $dice = new Dice($this, $db_dice->object);
                 $this->position += $dice->dice1;
                 $this->position += $dice->dice2;
                 if ($this->position > 15) {
                     $this->position -= 16;
                 }
                 //var_dump( $this->position );
             }
         }
     }
     $this->target = $this->position;
     $street = find(root($this), "Street", "name", "street" . $this->position);
     $this->x = $street->x;
     $this->z = $street->z;
     //var_dump( "position: " . $this->position . " target: " . $this->target );
 }
Пример #16
0
 function __construct($parent = null, $params_json = "")
 {
     $this->rotation = M_PI / 4;
     parent::__construct($parent, $params_json);
     $this->add(new Script($this, '{ "path":"threejs/examples/js/controls/OrbitControls.js", "region":"head" }'));
 }
Пример #17
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
 }
Пример #18
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
     $this->add(new Script($this, '{ "path":"threephp/js/TweenMax.min.js", "region":"head" }'));
 }
Пример #19
0
 function __construct($parent = null, $params_json = "")
 {
     $this->path = "";
     $this->region = "";
     parent::__construct($parent, $params_json);
 }
Пример #20
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
     $this->add(new Script($this, '{ "path":"threejs/examples/js/libs/stats.min.js", "region":"head" }'));
 }
Пример #21
0
 function __construct($parent = null, $params_json = "{}")
 {
     $this->amount = 0;
     parent::__construct($parent, $params_json);
     $this->name = "bank";
 }
Пример #22
0
 function __construct($parent = null, $params_json = "{}")
 {
     parent::__construct($parent, $params_json);
     $this->name = "dialog";
 }
Пример #23
0
 function __construct($parent = null, $params_json = "")
 {
     $this->color = 0x666666;
     parent::__construct($parent, $params_json);
 }