コード例 #1
0
        public override void Act()
        {
            base.Act();

            //Periodical logging of a Hero state
            if (temporary_log_counter < 200)
            {
                temporary_log_counter++;
            }
            else
            {
                Log.i(this, "X=" + X + " Y=" + Y +
                      " HP=" + Health + "/" + MaxHealth +
                      " Angle=" + Angle +
                      " Horizontal=" +
                      (Direction.Horizontal == SpaceDirection.HorizontalDirection.LEFT ? "Left" : (Direction.Horizontal == SpaceDirection.HorizontalDirection.RIGHT ? "Right" : "None")) +
                      " Vertical=" +
                      (Direction.Vertical == SpaceDirection.VerticalDirection.UP ? "Up" : (Direction.Vertical == SpaceDirection.VerticalDirection.DOWN ? "Down" : "None")));
                temporary_log_counter = 0;
            }

            //Act operation of the Clickable implementation
            Clickable.Act();

            //Changes speed based on strong will of the user, he can click on the hero to give him a morale boost
            if (Clicked)
            {
                Speed = 1.5f * HERO_SPEED;
            }
            else
            {
                Speed = HERO_SPEED;
            }
        }