Пример #1
0
 public void boxStoppedBeingHit(LaserController laserController, BoxController boxController)
 {
     if (laserController.hitIdentifier.Equals(this.hitIdentifier))
     {
         Dull();
     }
 }
Пример #2
0
 public void boxBeingHit(LaserController laserController, BoxController boxController)
 {
     if (laserController.hitIdentifier.Equals(this.hitIdentifier))
     {
         Glow();
     }
 }
    private void horizontalCheck()
    {
        while (rightSide != null)
        {
            number     = rightSide.GetComponent <BoxController>();
            lineTotal += number.boxNumber + number.valueChanger;
            rightSide  = number.rightSide;
        }

        while (leftSide != null)
        {
            number     = leftSide.GetComponent <BoxController>();
            lineTotal += number.boxNumber + number.valueChanger;
            leftSide   = number.leftSide;
        }

        if (lineTotal == parent.totalNumber)
        {
            horizontalDone = true;
        }

        lineTotal = boxNumber + valueChanger;

        leftSide  = originalLeftSide;
        rightSide = originalRightSide;
    }
    private void backwardDiagonalCheck()
    {
        while (bottomRightSide != null)
        {
            number          = bottomRightSide.GetComponent <BoxController>();
            lineTotal      += number.boxNumber + number.valueChanger;
            bottomRightSide = number.bottomRightSide;
        }

        while (topLeftSide != null)
        {
            number      = topLeftSide.GetComponent <BoxController>();
            lineTotal  += number.boxNumber + number.valueChanger;
            topLeftSide = number.topLeftSide;
        }

        if (lineTotal == parent.totalNumber)
        {
            backwardDone = true;
        }

        lineTotal = boxNumber + valueChanger;

        topLeftSide     = originalTopLeftSide;
        bottomRightSide = originalBottomRightSide;
    }
Пример #5
0
    //Controlamos que nos podemos mover hacia donde pulsamos
    bool Blocked(Vector3 position, Vector2 direction)
    {
        Vector2 newPos = new Vector2(position.x, position.y) + direction;

        GameObject[] walls = GameObject.FindGameObjectsWithTag("Wall");
        foreach (var wall in walls)
        {
            if (wall.transform.position.x == newPos.x && wall.transform.position.y == newPos.y)
            {
                return(true);
            }
        }
        GameObject[] boxes = GameObject.FindGameObjectsWithTag("Box");
        foreach (var box in boxes)
        {
            if (box.transform.position.x == newPos.x && box.transform.position.y == newPos.y)
            {
                BoxController bx = box.GetComponent <BoxController>();
                if (bx && bx.Move(direction))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Пример #6
0
    /*
     * protected private void OnCollisionEnter2D(Collision2D collision) {
     *  if (collision.collider.tag == Tags.BOX)
     *  {
     *      Debug.Log("colliding");
     *      boxInst = collision.collider.gameObject;
     *      Debug.Log(boxInst);
     *      inGrabRange = true;
     *  }
     * }
     */

    private void checkBoxInRange()
    {
        BoxController[] boxes = FindObjectsOfType <BoxController>();

        if (boxes.Length > 0 && !holding)
        {
            boxInst = boxes[0];

            for (int i = 1; i < boxes.Length; i++)
            {
                //pythagorean to check which boxes are closest
                float x1 = Mathf.Pow(boxes[i].transform.position.x - gameObject.transform.position.x, 2);
                float y1 = Mathf.Pow(boxes[i].transform.position.y - gameObject.transform.position.y, 2);
                float x2 = Mathf.Pow(boxInst.transform.position.x - gameObject.transform.position.x, 2);
                float y2 = Mathf.Pow(boxInst.transform.position.y - gameObject.transform.position.y, 2);

                if (x1 + y1 < x2 + y2)
                {
                    boxInst = boxes[i];
                }
            }
            float x = Mathf.Pow(boxInst.transform.position.x - gameObject.transform.position.x, 2);
            float y = Mathf.Pow(boxInst.transform.position.y - gameObject.transform.position.y, 2);

            if (x + y <= Mathf.Pow(range, 2))
            {
                inGrabRange = true;
            }
            else
            {
                inGrabRange = false;
            }
        }
    }
Пример #7
0
 void Start()
 {
     onDamage = false;
     count    = 0;
     mBox     = gameObject.GetComponent <BoxController> ();
     init();
 }
Пример #8
0
    public void changeMine(BoxController bc)
    {
        if (firsClickMine)
        {
            while (firsClickMine && bc.mined)
            {
                for (int y = 0; y <= heightMines - 1; y++)
                {
                    for (int x = 0; x <= widthMines - 1; x++)
                    {
                        if (allBoxes[y, x].mined == false && firsClickMine && Random.Range(0, 10) == 1)
                        {
                            firsClickMine        = false;
                            matrizMines[y, x]    = true;
                            allBoxes[y, x].mined = true;
                        }
                    }
                }
            }

            bc.mined = false;
            matrizMines[bc.boxPositionHeight, bc.boxPositionWidth] = false;
            firsClickMine = false;
        }
    }
Пример #9
0
 // Уничтожаем (убираем в пул)
 public static void DestroyBox(BoxController box)
 {
     // Возвращаем объект в пул
     box.gameObject.SetActive(false);
     box.transform.position = GameManager.Instance.boxPoolPositionPosition.transform.position;
     boxPool.Enqueue(box);
 }
Пример #10
0
 private void IdNetworkkBoxPandoraInServer(BoxController boxController)
 {
     if (boxController != null)
     {
         ExtractBoxPandoraServer(boxController.GetComponent <NetworkIdentity>().netId);
     }
 }
Пример #11
0
 void ShowDictionary(BoxController box)
 {
     foreach (string key in box.attributes.Keys)
     {
         //Debug.Log(key + "is " + box.attributes[key]);
     }
 }
Пример #12
0
    public void SetCell()
    {
        button = this.GetComponent <Button>();
        button.onClick.AddListener(() => OnCellSelect());

        inputfield = this.GetComponentInChildren <Text>();

        DefaultColor = this.GetComponent <Image>().color;
        Valid_Color  = inputfield.color;

        Parent         = this.transform.parent.gameObject;
        box_controller = Parent.GetComponent <BoxController>();


        RowList    = SudokhuController.Instance.RowList;
        ColumnList = SudokhuController.Instance.ColumnList;

        button.enabled = Isclick;
        button.enabled = Isclick;
        if (!Isclick)
        {
            inputfield.text = Value;
        }
        else
        {
            inputfield.text = "";
        }
    }
Пример #13
0
    private void verticalCheck()
    {
        while (topSide != null)
        {
            number     = topSide.GetComponent <BoxController>();
            lineTotal += number.boxNumber + number.valueChanger;
            topSide    = number.topSide;
        }

        while (bottomSide != null)
        {
            number     = bottomSide.GetComponent <BoxController>();
            lineTotal += number.boxNumber + number.valueChanger;
            bottomSide = number.bottomSide;
        }

        if (lineTotal == parent.totalNumber)
        {
            verticalDone = true;
        }

        lineTotal = boxNumber + valueChanger;

        topSide    = originalTopSide;
        bottomSide = originalBottomSide;
    }
Пример #14
0
    /// <summary>
    /// Handles all input that vertically displaces the parameter box
    /// </summary>
    /// <param name="p_Box">P box.</param>
    private void verticalInput(BoxController p_Box)
    {
        // UP : Tier 1
        if (Input.GetKeyDown(KeyCode.W))
        {
            p_Box.setTextTo("w");
            p_Box.setDisplacementAmount(1 * displacementAmount);
            p_Box.setState(BoxController.BoxState.POSITIVE);
        }


        // UP : Tier 2
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.W))
        {
            p_Box.setTextTo("W");
            p_Box.setDisplacementAmount(2 * displacementAmount);
            p_Box.setState(BoxController.BoxState.POSITIVE);
        }

        // DOWN : Tier 1
        if (Input.GetKeyDown(KeyCode.S))
        {
            p_Box.setTextTo("s");
            p_Box.setDisplacementAmount(-1 * displacementAmount);
            p_Box.setState(BoxController.BoxState.NEGATIVE);
        }

        // DOWN : Tier 2
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.S))
        {
            p_Box.setTextTo("S");
            p_Box.setDisplacementAmount(-2 * displacementAmount);
            p_Box.setState(BoxController.BoxState.NEGATIVE);
        }
    }
Пример #15
0
    public override void Init()
    {
        base.Init();

        if (matricies == null)
        {
            // Set Matrix Set
            matricies = new EmitterMatricies();
            matricies.Init();
        }

        if (targetController == null)
        {
            targetController = new TargetController();
        }

        if (emitterController == null)
        {
            emitterController = new EmitterController();
        }

        if (reflectorController == null)
        {
            reflectorController = new ReflectorController();
        }

        if (boxController == null)
        {
            boxController = new BoxController();
        }

        InitScenePuzzle();
    }
Пример #16
0
    private void OnTriggerStay(Collider other)
    {
        if (Input.GetKeyDown(KeyCode.E) && _pickedUpBox == null)
        {
            _pickedUpBox = other.GetComponent <BoxController>();

            if (_pickedUpBox != null && _pickedUpBox.Model.CanMoveBy(Game.Instance.PrincessCake.Model))
            {
                Game.Instance.Logger.Info("Picked Up box: " + _pickedUpBox);

                _pickedUpBox.GetComponent <Rigidbody>().isKinematic = true;
                _pickedUpBox.transform.position = transform.position;
                _pickedUpBox.transform.SetParent(transform);

                StopAllCoroutines();
                StartCoroutine(HandleInput());

                _audio.TryPlaySFX(_onPickUp);
            }
            else
            {
                StopAllCoroutines();
                _pickedUpBox = null;
            }
        }
    }
Пример #17
0
    void OnTriggerEnter2D(Collider2D col)
    {
        BoxController b_col = col.GetComponent <BoxController>();

        if ((type.Equals(EnumsGame.TYPE_BOX.IMAGE_BOX_RAND_VOWEL) || type.Equals(EnumsGame.TYPE_BOX.IMAGE_BOX)) && b_col != null)
        {
            if (!(b_col == PlayerController.instance.BoxHold))
            {
                return;
            }
            PlayerController.instance.letHold();
            if (letter_a.Equals(b_col.letter_a))
            {
                b_col.gameObject.SetActive(false);
                rightBox();
                //PlayerData.instance.turnData.rights.Add(letter_a);
                PlayerData.instance.addRightLetter(letter_a, -1);
                PlayerData.instance.turnData.right++;
            }
            else if (timeToTestRight <= 0 && !b_col.used)
            {
                b_col.wrongBox();
                wrongBox();
                PlayerData.instance.addWrongLetter(letter_a, -1);
                PlayerData.instance.turnData.unright++;
            }
        }
    }
Пример #18
0
        static void Main(string[] args)
        {
            try
            {
                BoxController bc    = new BoxController();
                var           boxes = bc.GetAllBoxes();

                foreach (var item in boxes)
                {
                    bc.RearrangeBox(item);
                    Console.WriteLine("Box_ID : " + item.BOX_ID + " calculated.");
                }

                var box_parts = bc.GetAllReadyBoxes();

                Console.WriteLine("");
                Console.WriteLine("BOX_ID   PART_NUMBER     PART_WEIGHT     PART_COST");
                Console.WriteLine("---------------------------------------------------");

                foreach (var item in box_parts)
                {
                    Console.WriteLine(item.BOX_ID + "   " + item.PART_NUMBER + "    " + item.PART_WEIGHT.ToString("N") + "    " + item.PART_COST.ToString("N"));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Hata detayı : " + ex.Message);
            }
        }
Пример #19
0
 public void deactivateBoxes()
 {
     for (float x = bottomLeftPoint.position.x; x <= topRightPoint.position.x; x++)
     {
         for (float y = bottomLeftPoint.position.y; y <= topRightPoint.position.y; y++)
         {
             overlapPositions = Physics2D.OverlapCircleAll(new Vector3(x, y, 0), .25f);                 //tempBox = boxObj at this Position
             for (int i = 0; i < overlapPositions.Length; i++)
             {
                 if (overlapPositions[i].tag == "ActiveBox" || overlapPositions[i].tag == "InActiveBox")
                 {
                     tempBox = overlapPositions[i].gameObject;
                 }
             }
             if (tempBox != null)
             {
                 tempBoxControllerScript = tempBox.GetComponent <BoxController> ();
                 if (tempBoxControllerScript != null)
                 {
                     tempBoxControllerScript.setIsActiveFalse();
                 }
                 else
                 {
                     Debug.Log("BoxSpawner: tempBoxControllerScript is null. (2) ");
                 }
             }
             else
             {
                 Debug.Log("BoxSpawner: tempBox is null. (2)");
             }
         }
     }
 }
Пример #20
0
    void AddOrder()

    {
        GameObject    order      = ObjectPooler.Instance.SpawnFromPool(Pool.NORMAL_BOX, transform.position, Quaternion.identity);
        BoxController currentBox = order.GetComponent <BoxController>();

        currentBox.OnObjectSpawn();
        int status    = Random.Range(0, 4);
        int type      = Random.Range(0, 3);
        int bubbleRNG = Random.Range(0, 2);

        if (status != 3)
        {
            currentBox.attributes[currentBox.fields[status]] = true;
        }
        if (bubbleRNG == 0)
        {
            currentBox.attributes[currentBox.fields[3]] = true;
        }
        switch (type)
        {
        case 1:
            currentBox.isHeavy = true;
            break;

        case 2:
            currentBox.isFragile = true;
            break;

        default:
            break;
        }
        Debug.Log("Here");
        BoxOrderController.instance.Add(currentBox);
    }
Пример #21
0
 private void CheckPressInteractButton(BoxController boxController)
 {
     if (Input.GetKeyDown(_interactKey))
     {
         IdNetworkkBoxPandoraInServer(boxController);
     }
 }
Пример #22
0
 public SerializedBox(BoxController bc)
 {
     given   = bc.given;
     answer  = bc.currentVisibleFull;
     posx    = bc.position.x;
     posy    = bc.position.y;
     visible = bc.visible;
 }
Пример #23
0
 public void Setup()
 {
     boxServiceMock        = new Mock <IBoxService>();
     playerServiceMock     = new Mock <IPlayerService>();
     unitOfWorkFactoryMock = new Mock <IUnitOfWorkFactory>();
     ticTacToeContextMock  = new Mock <ITicTacToeContext>();
     controller            = new BoxController(boxServiceMock.Object, playerServiceMock.Object, unitOfWorkFactoryMock.Object);
 }
Пример #24
0
 public BoxState(BoxController bc)
 {
     color      = bc.currentColor;
     centreMode = bc.centreMode;
     full       = bc.currentFull;
     corners    = bc.cornerElements;
     centres    = bc.centreElements;
 }
Пример #25
0
    // Use this for initialization
    void Start()
    {
        boxController = new BoxController(prefabBox, GameObject.Find("Box0"));
        status        = 0;

        //之后可以不用返回这个newBox,因为并不需要在这一层次直接控制newBox,而是通过BoxController来控制
        //在生成新盒子的时候也要指定盒子的移动方式
        boxController.GenerateNewBox(this.XMoveReference);
    }
Пример #26
0
 public void Claim(BoxController controller)
 {
     if (hasOwner)
     {
         return;
     }
     owner    = controller;
     hasOwner = true;
 }
Пример #27
0
 // Use this for initialization
 void Start()
 {
     _controller = GetComponent <BoxController>();
     _pattern    = _patterns[Random.Range(0, _patterns.Length)];
     _offset     = Random.Range(0, 2);
     Fill();
     Remove();
     _controller.Type = _pattern.Substring(0, 1);
 }
Пример #28
0
    private void Awake()
    {
        initialPosition = transform.position;

        if (trigger != null)
        {
            boxTrigger = trigger.GetComponent <Scr_BoxTrigger>();
        }

        if (trigger1 != null)
        {
            boxTrigger1 = trigger1.GetComponent <Scr_BoxTrigger>();
        }

        if (trigger2 != null)
        {
            boxTrigger2 = trigger2.GetComponent <Scr_BoxTrigger>();
        }

        if (trigger3 != null)
        {
            boxTrigger3 = trigger3.GetComponent <Scr_BoxTrigger>();
        }

        boxController = GetComponent <BoxController>();

        colliderCaja = GetComponent <BoxCollider2D>();
        trail        = GetComponentInChildren <ParticleSystem>();
        sprite       = GetComponentInChildren <SpriteRenderer>();

        switch (resetMode)
        {
        case ResetMode.ExitTrigger:
            if (boxTrigger != null)
            {
                boxTrigger.insideStart = true;
            }
            initialTime = timeAfterExit;
            break;

        case ResetMode.EnterTrigger:
            if (boxTrigger != null)
            {
                boxTrigger.insideStart = false;
            }
            initialTime = timeAfterEnter;
            break;

        case ResetMode.Heigh:
            initialTime = heighTime;
            break;

        case ResetMode.Time:
            initialTime = time;
            break;
        }
    }
Пример #29
0
    private bool ExplodeTile(int xTile, int zTile)
    {
        Vector3 ExpolsionCenterWorldSpace = owner.Arena.transform.TransformPoint(new Vector3(xTile, 0, zTile));

        Collider[] hits   = Physics.OverlapBox(ExpolsionCenterWorldSpace, Vector3.one / 3f, Quaternion.identity, BombsHitLayer);
        Collider[] blocks = Physics.OverlapBox(ExpolsionCenterWorldSpace, Vector3.one / 3f, Quaternion.identity, BombsBlockedLayer);

        //Is blocked
        if (blocks.Length > 0)
        {
            return(true);
        }

        //Do come visual gargabe
        if (ShowDeBugExplosion)
        {
            Debug.DrawLine(ExpolsionCenterWorldSpace + new Vector3(0.5f, 0, 0.5f), ExpolsionCenterWorldSpace + new Vector3(-0.5f, 0, -0.5f), Color.red, 0.2f);
            Debug.DrawLine(ExpolsionCenterWorldSpace + new Vector3(0.5f, 0, -0.5f), ExpolsionCenterWorldSpace + new Vector3(-0.5f, 0, 0.5f), Color.red, 0.2f);
        }
        else
        {
            Instantiate(ExplosionGrapic, ExpolsionCenterWorldSpace, Quaternion.identity, null);
        }

        //Call hits on players and bomb in square!
        for (int i = 0; i < hits.Length; i++)
        {
            //Skip if object is not in right cell
            bool sameX = Mathf.RoundToInt(hits[i].gameObject.transform.localPosition.x) == xTile;
            bool sameZ = Mathf.RoundToInt(hits[i].gameObject.transform.localPosition.z) == zTile;
            if (!sameX || !sameZ)
            {
                continue;
            }

            PlayerController player = hits[i].GetComponentInParent <PlayerController>();
            if (player != null)
            {
                player.Hit(owner);
            }

            BombController bomb = hits[i].GetComponentInParent <BombController>();
            if (bomb != null)
            {
                bomb.Hit(owner);
            }

            BoxController box = hits[i].GetComponentInParent <BoxController>();
            if (box != null)
            {
                box.Hit(owner);
                return(true);
            }
        }

        return(false);
    }
Пример #30
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.gameObject.name == "LeftHit")
     {
         bc = other.transform.parent.gameObject.GetComponent <BoxController>();
         if (noNow[0] == bc.SetNo())//記憶した番号を削除
         {
             noNow[0]   = 0;
             boxSize[0] = 0;
             bcClone[0] = null;
         }
         else if (noNow[1] == bc.SetNo())
         {
             noNow[1]   = 0;
             boxSize[1] = 0;
             bcClone[1] = null;
         }
         else if (noNow[2] == bc.SetNo())
         {
             noNow[2]   = 0;
             boxSize[2] = 0;
             bcClone[2] = null;
         }
         else if (noNow[3] == bc.SetNo())
         {
             noNow[3]   = 0;
             boxSize[3] = 0;
             bcClone[3] = null;
         }
         else if (noNow[4] == bc.SetNo())
         {
             noNow[4]   = 0;
             boxSize[4] = 0;
             bcClone[4] = null;
         }
         else if (noNow[5] == bc.SetNo())
         {
             noNow[5]   = 0;
             boxSize[5] = 0;
             bcClone[5] = null;
         }
         else if (noNow[6] == bc.SetNo())
         {
             noNow[6]   = 0;
             boxSize[6] = 0;
             bcClone[6] = null;
         }
         else if (noNow[7] == bc.SetNo())
         {
             noNow[7]   = 0;
             boxSize[7] = 0;
             bcClone[7] = null;
         }
         bc.compFalse();
         //Debug.LogError("離れました:" + gameObject.name + ":" + bc.SetNo() + ":" + bc.SetBoxSize());
     }
 }
Пример #31
0
 void Start () {
     mAnimator = GetComponent<Animator>();
     randomWait = ((float)Random.Range(1000,4000))/1000.0f;
     isRoaming = false;
     monster = transform.GetComponent<BoxController>();
     isChase = false;
     chaseWait = 1.0f;
     attackCD = 1.5f;
 }
Пример #32
0
 void Start()
 {
     if (Camera.main != null)
     {
         mCamera = Camera.main.transform;
     }
     else Debug.Log("userinput_controller::No main camera");
     mBox = transform.GetComponent<BoxController>();
 }
Пример #33
0
    void Start () {
        onDamage = false;
        count = 0;
		mBox = gameObject.GetComponent<BoxController> ();
		init ();
    }
Пример #34
0
        public override void init()
        {
            #region ground
            MeshManager.Singleton.CreatePlane("ground",
                ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME,
                new Plane(Mogre.Vector3.UNIT_Y, 0),
                1500, 1500, 20, 20, true, 1, 5, 5, Mogre.Vector3.UNIT_Z);
            // Create a ground plane
            entities.Add(OgreWindow.Instance.mSceneMgr.CreateEntity("GroundEntity", "ground"));
            entities["GroundEntity"].CastShadows = false;
            entities["GroundEntity"].SetMaterialName("dirt");
            nodes.Add(OgreWindow.Instance.mSceneMgr.RootSceneNode.CreateChildSceneNode("ground"));
            nodes["ground"].AttachObject(entities["GroundEntity"]);
            nodes["ground"].Position = new Mogre.Vector3(0f, 0f, 0f) + Location().toMogre;

            // the actor properties control the mass, position and orientation
            // if you leave the body set to null it will become a static actor and wont move
            ActorDesc actorDesc2 = new ActorDesc();
            actorDesc2.Density = 4;
            actorDesc2.Body = null;
            actorDesc2.GlobalPosition = nodes["ground"].Position;
            actorDesc2.GlobalOrientation = nodes["ground"].Orientation.ToRotationMatrix();

            PhysXHelpers.StaticMeshData meshdata = new PhysXHelpers.StaticMeshData(entities["GroundEntity"].GetMesh());
            actorDesc2.Shapes.Add(PhysXHelpers.CreateTriangleMesh(meshdata));
            Actor actor2 = null;
            try { actor2 = OgreWindow.Instance.scene.CreateActor(actorDesc2); }
            catch (System.AccessViolationException ex) { log(ex.ToString()); }
            if (actor2 != null)
            {
                // create our special actor node to tie together the scene node and actor that we can update its position later
                ActorNode actorNode2 = new ActorNode(nodes["ground"], actor2);
                actors.Add(actorNode2);
            }
            #endregion

            lights.Add(OgreWindow.Instance.mSceneMgr.CreateLight("playerLight"));
            lights["playerLight"].Type = Light.LightTypes.LT_POINT;
            lights["playerLight"].Position = Location().toMogre;
            lights["playerLight"].DiffuseColour = ColourValue.White;
            lights["playerLight"].SpecularColour = ColourValue.White;

            #region drone

            OgreWindow.Instance.skeletons["\\Drone.skeleton"].Load();
            OgreWindow.Instance.meshes["\\Drone.mesh"].Load();
            OgreWindow.Instance.meshes["\\Drone.mesh"].SkeletonName = "\\Drone.skeleton";

            entities.Add(OgreWindow.Instance.mSceneMgr.CreateEntity("drone", "\\Drone.mesh"));

            entities["drone"].CastShadows = true;
            walkState = entities["drone"].GetAnimationState("walk");
            walkState.Enabled = true;
            walkState.Loop = true;
            entities["drone"].SetMaterialName("metal");
            nodes.Add(OgreWindow.Instance.mSceneMgr.RootSceneNode.CreateChildSceneNode("drone"));
            nodes["drone"].AttachObject(entities["drone"]);
            nodes["drone"].Position = new Mogre.Vector3(0f, 40f, 0f) + Location().toMogre;
            nodes["drone"].Scale(new Mogre.Vector3(.3f));

            nodes.Add(nodes["drone"].CreateChildSceneNode("orbit0"));
            nodes.Add(nodes["orbit0"].CreateChildSceneNode("orbit"));
            nodes["orbit"].Position = Location().toMogre;
            nodes["orbit"].AttachObject(OgreWindow.Instance.mCamera);
            nodes["drone"].SetFixedYawAxis(true);

            #endregion

            //#region baseball
            //entities.Add(OgreWindow.Instance.mSceneMgr.CreateEntity("baseball", "\\baseball.mesh"));
            //entities["baseball"].SetMaterialName("baseball");
            ////nodes.Add(OgreWindow.Instance.mSceneMgr.RootSceneNode.CreateChildSceneNode("baseball"));
            //nodes.Add(nodes["drone"].CreateChildSceneNode("baseball"));
            //nodes["baseball"].AttachObject(entities["baseball"]);
            //nodes["baseball"].SetScale(.5f, .5f, .5f);
            //nodes["baseball"].SetPosition(-3f, 7f, 3f);
            //// nodes["baseball"].SetScale(5f, 5f, 5f);
            //#endregion

            #region player physics
            bcd = new BoxControllerDesc();
            control = OgreWindow.Instance.physics.ControllerManager.CreateController(OgreWindow.Instance.scene, bcd); //System.NullReferenceException
            #endregion

            nodes.Add(OgreWindow.Instance.mSceneMgr.RootSceneNode.CreateChildSceneNode("suspensionY"));

            OgreWindow.g_m.MouseMoved += new MouseListener.MouseMovedHandler(mouseMoved);
            middlemousetimer.reset();
            middlemousetimer.start();

            this.btnLimiter_F.reset();
            this.btnLimiter_F.start();

            ready = true;
            new Thread(new ThreadStart(controlThread)).Start();
            new Thread(new ThreadStart(statusUpdaterThread)).Start();

            localY = nodes["drone"]._getDerivedOrientation() * Mogre.Vector3.UNIT_Y;
            localZ = nodes["drone"]._getDerivedOrientation() * Mogre.Vector3.UNIT_Z;
            localX = nodes["drone"]._getDerivedOrientation() * Mogre.Vector3.UNIT_X;

            OgreWindow.Instance.tbTextToSend.GotFocus += new EventHandler(tbTextToSend_GotFocus);
            OgreWindow.Instance.tbTextToSend.LostFocus += new EventHandler(tbTextToSend_LostFocus);
            OgreWindow.Instance.tbConsole.GotFocus += new EventHandler(tbConsole_GotFocus);
            OgreWindow.Instance.tbConsole.LostFocus += new EventHandler(tbConsole_LostFocus);
        }