Exemplo n.º 1
0
        /// <summary>
        /// Moves the speech sprites appropriately for drawing.
        /// </summary>
        /// <param name="args"></param>
        private void MoveSpeechSprites(DrawingArgs args)
        {
            foreach (Prayer prayer in Game.State.Prayers)
            {
                // Ignore if we don't have it
                if (!speechSprites.Contains(prayer))
                {
                    continue;
                }

                // Move the sprite
                PrayerSpeechSprite pss = speechSprites[prayer];
                PointF             p   = blockViewport.ToPoint(
                    prayer.X,
                    prayer.Y,
                    prayer.BottomPosition);
                p.X      += blockViewport.BlockWidth - blockViewport.BlockWidth / 3;
                p.Y      -= 2 * blockViewport.BlockOffsetZ;
                pss.Point = p;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the various speech bubbles for all prayers.
        /// </summary>
        private void UpdateSpeechBubbles(UpdateArgs args)
        {
            // Keep a list of keys, so we know which ones to remove
            ArrayList <Prayer> tmpPrayers = new ArrayList <Prayer>();

            tmpPrayers.AddAll(speechSprites.Keys);

            // Loop through our list of speed sprites
            foreach (Prayer prayer in Game.State.Prayers)
            {
                // See if we have one
                PrayerSpeechSprite pss = null;

                if (!speechSprites.Contains(prayer))
                {
                    // We need to construct the speech sprite
                    pss = new PrayerSpeechSprite(prayer);
                    speeches.Add(pss);
                    speechSprites[prayer] = pss;
                }
                else
                {
                    // Pull out the speech sprite
                    pss = speechSprites[prayer];
                    tmpPrayers.Remove(prayer);
                }

                // Update the sprite
                pss.Update(args);
            }

            // Remove everything left since we don't have it anymore
            foreach (Prayer prayer in tmpPrayers)
            {
                // Remove from our sprites
                speeches.Remove(speechSprites[prayer]);
                speechSprites.Remove(prayer);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Updates the various speech bubbles for all prayers.
        /// </summary>
        private void UpdateSpeechBubbles(UpdateArgs args)
        {
            // Keep a list of keys, so we know which ones to remove
            ArrayList<Prayer> tmpPrayers = new ArrayList<Prayer>();
            tmpPrayers.AddAll(speechSprites.Keys);

            // Loop through our list of speed sprites
            foreach (Prayer prayer in Game.State.Prayers)
            {
                // See if we have one
                PrayerSpeechSprite pss = null;

                if (!speechSprites.Contains(prayer))
                {
                    // We need to construct the speech sprite
                    pss = new PrayerSpeechSprite(prayer);
                    speeches.Add(pss);
                    speechSprites[prayer] = pss;
                }
                else
                {
                    // Pull out the speech sprite
                    pss = speechSprites[prayer];
                    tmpPrayers.Remove(prayer);
                }

                // Update the sprite
                pss.Update(args);
            }

            // Remove everything left since we don't have it anymore
            foreach (Prayer prayer in tmpPrayers)
            {
                // Remove from our sprites
                speeches.Remove(speechSprites[prayer]);
                speechSprites.Remove(prayer);
            }
        }