コード例 #1
0
        private void UpdateDiamonds(GameTime dt)
        {
            for (int i = 0; i < diamonds.Count; ++i)
            {
                Diamonds diam = diamonds[i];
                diam.Update(dt);

                if (diam.BoundingCircle.Intersects(Player.BoundingRect))
                {
                    diamonds.RemoveAt(i--);
                    CollectDiamond(diam, Player);
                }
            }
        }
コード例 #2
0
 private void CollectDiamond(Diamonds diam, Player pl)
 {
     score += Diamonds.AddPoints;
     diam.Collected(pl);
 }