コード例 #1
0
        /// <summary>
        /// Called when a gem is collected.
        /// </summary>
        /// <param name="gem">The gem that was collected.</param>
        /// <param name="collectedBy">The player who collected this gem.</param>
        private void OnGemCollected(Gem gem, Player collectedBy)
        {
            Score += Gem.PointValue;

            gem.OnCollected(collectedBy);
        }
コード例 #2
0
        /// <summary>
        /// Instantiates a gem and puts it in the level.
        /// </summary>
        private Tile LoadGemTile(int x, int y)
        {
            Point position = GetBounds(x, y).Center;
            var gem = new Gem(this, new Vector2(position.X, position.Y));
            gems.Add(gem);
            Game.Penumbra.Lights.Add(gem.Light);

            return new Tile(null, TileCollision.Passable);
        }