Exemple #1
0
        /// <summary>
        /// Draws a projectile object from the world.
        /// </summary>
        private void ProjectileDrawer(object o, PaintEventArgs e)
        {
            Projectile p         = o as Projectile;
            int        projWidth = 35;

            //retrieve image from Projectiles image dictionary, based on ownerID
            Image image = Projectiles[p.GetOwnerID() % 8];

            Rectangle r = new Rectangle(-(projWidth / 2), -(projWidth / 2), projWidth, projWidth);

            e.Graphics.DrawImage(image, r);
        }