public void OperatorEquals_DifferentTypes_False()
        {
            GameObject  gameObject = new GameObject();
            GameScreen  screen     = gameObject.AddComponent <GameScreen>();
            GameUIState state1     = new MoveState(screen);
            GameUIState state2     = new AnimatingState(screen);

            Assert.IsFalse(state1 == state2);
        }
        /// <summary>
        /// Disables the panel GUI, will automatically animate out after disable
        /// </summary>
        public void DisablePanel()
        {
            m_CurrSlideXY   = slideOutXY;
            m_CurrAnimState = AnimatingState.SLIDE_OUT;

            ClearAnimationCompleteDelegates();

            isActive = false;
        }
        /// <summary>
        /// Enables the panel GUI, will automatically animate in after enable
        /// </summary>
        public void EnablePanel()
        {
            m_CurrSlideXY   = slideInXY;
            m_CurrAnimState = AnimatingState.SLIDE_IN;

            isActive = true;

            MainController.Instance.DisableCamera();
        }
Exemple #4
0
        void d_Completed(object sender, EventArgs e)
        {
            if (animatingState == AnimatingState.Moving)
            {
                if (path.Count > 0)
                {
                    location = last_location;
                    relocate();

                    translateByLineTo(path[0]);
                    last_location = path[0];
                    path.RemoveAt(0);
                    return;
                }
                else
                {
                    ellipse.RenderTransform = null;
                    location = last_location;
                    relocate();

                    ballMovingCompleted();
                }
            }
            animatingState = AnimatingState.Stopped;
        }
Exemple #5
0
        public void moveTo(int x, int y)
        {
            var newloc = new Point(x, y);

            path = game.findPath(location, newloc);

            string s = "";
            foreach (var a in path) s += ", " + "[" + a.x + "," + a.y + "]";
            // game.ShowMessage(s);

            if (path != null && path.Count > 0)
            {
                path.RemoveAt(0);

                animatingState = AnimatingState.Moving;

                translateByLineTo(path[0]);
                last_location = path[0];
                path.RemoveAt(0);
            }
        }
Exemple #6
0
 public void stopAnimation()
 {
     tt.BeginAnimation(TranslateTransform.YProperty, null);
     animatingState = AnimatingState.Stopped;
 }
Exemple #7
0
        public void startAnimation()
        {
            da.From = 0;
            da.To = -5;
            da.Duration = new Duration(TimeSpan.FromSeconds(0.3));
            da.RepeatBehavior = RepeatBehavior.Forever;
            da.AutoReverse = true;

            ellipse.RenderTransform = tt;
            tt.BeginAnimation(TranslateTransform.YProperty, da);

            animatingState = AnimatingState.Jumping;
        }
Exemple #8
0
    void Start()
    {
        PlayerAutomate = false;

        AutomateSpeed = 0.01f;
        AnswerCount = 0;

        DebugScript = GameObject.Find("DebugObject").GetComponent<GameDebugScript>();

        Basic = GameObject.Find("Basic");
        Strong = GameObject.Find("Strong");
        Special = GameObject.Find("Special");

        NoCombatState   = new NoCombatState(this);
        AttackState     = new AttackState(this);
        DefenseState    = new DefenseState(this);
        AnswerState     = new AnswerState(this);
        AnimatingState  = new AnimatingState(this);

        Camera = new CameraController(GameObject.Find("Main Camera"));
        Waypoint = new Waypoint();
        Waypoint.CurrentPosition = new Vector3(-1.65f, 0.9f, -1.0f);
        Waypoint.WaypointPosition = new Vector3(0.9f, 0.9f, -1.0f);
        MonsterWaypoint = new Vector3(3.1f, 1.05f, -1.0f);
        Camera.WaypointPosition = Waypoint.WaypointPosition + new Vector3(1.1f, 0f, -10.0f);
        WaypointCounter = 0;

        UIView = GameObject.Find("GameController").GetComponent<UIView>();

        PlayerFactory = new PlayerFactory();
        EnemyFactory = new EnemyFactory();

        // Player Factory
        Player = PlayerFactory.CreatePlayer("Wizard", Application.loadedLevel, GameObject.Find("Player"));

        Player.WaypointPosition = Waypoint.WaypointPosition;

        State = NoCombatState;
    }