예제 #1
0
        public void Update(GameTime gameTime, PlayerOrb player)
        {
            if (!_dangerous)
            {
                if (!CheckCollision(Position, player.Position))
                {
                    return;
                }

                _parent.IncScore();
                IsFinished = true;
            }
            else
            {
                if (CheckCollision(Position, player.Position))
                {
                    player.Throw();
                    IsFinished = true;
                }

                _dangerCountdown -= (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (_dangerCountdown <= 0)
                {
                    _dangerous = false;
                }
            }
        }