コード例 #1
0
        protected override bool HandleCollision(GameTime gameTime)
        {
            var player = Collides.Find(item => item is Player) as Player;

            if (player == null)
            {
                return(false);
            }

            AddPowerup(gameTime, player);
            return(true);
        }
コード例 #2
0
        protected override bool HandleCollision()
        {
            var player = Collides.Find(item => item is Player) as Player;

            if (player == null)
            {
                return(false);
            }

            player.TakeDamage(1);
            return(true);
        }
コード例 #3
0
        protected override bool HandleCollision()
        {
            var target = Collides.Find(item => item is IDamageable) as IDamageable;

            if (target == null || Owner == target)
            {
                return(false);
            }

            target.TakeDamage(1);
            Active = false;
            return(true);
        }