Пример #1
0
 public virtual void OnProjectileFired(ProjectileFiredEventArgs e)
 {
 }
Пример #2
0
        public void InvokeOnProjectileFired(int projectileID, int ownerID,
            int projectileTypeId, VTankObject.Point projectilePosition)
        {
            Player owner = Game.GetPlayerByID(ownerID);
            if (owner != null)
            {
                double angle = Math.Atan2(owner.Position.y - projectilePosition.y,
                    owner.Position.x - projectilePosition.x);

                Projectile projectile = new Projectile(
                    projectileID, owner.Weapon.ProjectileID, projectilePosition, angle);
                ProjectileFiredEventArgs args = new ProjectileFiredEventArgs(
                    owner, projectile);

                Game.AddProjectile(projectile);

                OnProjectileFired(args);

                args.Dispose();
            }
        }