Ejemplo n.º 1
0
        }     //end move(float, int)

        public void Move(float moveX, float moveY, float moveZ)
        {
            x += moveX;
            y += moveY;
            z += moveZ;

            if (findGlobalCollision())
            {
                x -= moveX;
                y -= moveY;
                z -= moveZ;
            }
            else
            {
                StateInGame.checkCombat(moveX + moveY + moveZ);
            }
        }
Ejemplo n.º 2
0
        public void Move(float targetMove, int vector)
        {
            float move;

            if (targetMove > 0)
            {
                move = targetMove + 3.5f;
            }
            else
            {
                move = targetMove + 0.5f;
            }

            float secondaryMove;

            if (targetMove > 0)
            {
                secondaryMove = 2.0f;
            }
            else
            {
                secondaryMove = 2.0f;
            }

            switch (vector)
            {
            case Globals.VECTOR_X:
                x += move;
                y += secondaryMove;
                break;

            case Globals.VECTOR_Y:
                y += move;
                x += secondaryMove;
                break;

            case Globals.VECTOR_Z:
                z += move;
                break;
            }//end switch(vector)

            if (findGlobalCollision())
            {
                switch (vector)
                {
                case Globals.VECTOR_X:
                    x -= move;
                    y -= secondaryMove;
                    break;

                case Globals.VECTOR_Y:
                    y -= move;
                    x -= secondaryMove;
                    break;

                case Globals.VECTOR_Z:
                    z -= move;
                    break;
                } //end swithc(vector)
            }     //end if(collision)
            else  //move > 0
            {
                switch (vector)
                {
                case Globals.VECTOR_X:
                    x -= move - targetMove;
                    y -= secondaryMove;
                    break;

                case Globals.VECTOR_Y:
                    y -= move - targetMove;
                    x -= secondaryMove;
                    break;

                case Globals.VECTOR_Z:
                    z -= 3.5f;
                    break;
                }//end switch(vector)

                int[] updates = { Globals.QUEST_EXPLORE, ((int)x + 1) / 4, ((int)y + 1) / 4 };
                StateHandler.Quest.QuestUpdate(updates);

                StateInGame.checkCombat(targetMove);
            } //end else move > 0
        }     //end move(float, int)