コード例 #1
0
        public void Update(Character selfChar, GameTime gameTime, BaseLevel level)
        {
            _tempChar            = selfChar;
            _tempElapsedMs       = gameTime.TotalGameTime.TotalMilliseconds;
            _tempCollisionBlocks = level.GetNearCollidableBlocks(Position);

            if (_input is Input)
            {
                (_input as Input).Update();
            }
            if (_input is AI)
            {
                (_input as AI).Update(selfChar, level, _tempElapsedMs, _prevElapsedMs);
            }

            if (_input != _prevInput || _tempElapsedMs - SECOND > _prevElapsedMs)
            {
                _prevElapsedMs = _tempElapsedMs;
            }

            updatePosition(level);
            updateDirection();
            updateAction();

            _prevInput     = _input;
            _prevElapsedMs = _tempElapsedMs;
        }